Bonjour Le forum,
Pourriez-vous m'aider svp ?
Je cherche le bout de code supplémentaire qui me permettrai d'appliquer la macro ci-dessous uniquement aux lignes visibles (masquées via un bouton) de ma feuille.
Private Sub Worksheet_Activate()
Dim c As Range
txt = ""
txt1 = ""
With Sheets("Feuil1")
For Each c In Range(.[M5], [M65536].End(xlUp))
If c <> "" Then
If c.Value < Date Then
If txt = "" Then txt = "Dates échues:" & vbCrLf & vbCrLf
txt = txt & c.Offset(, -11) & " - PO " & c.Offset(, -1) & " - Terminée le : " & c.Offset(, 0) & vbCrLf
ElseIf c.Value < Date + 30 Then
If txt1 = "" Then txtl = "Dates arrivent à échéance:" & vbCrLf & vbCrLf
txt1 = txt1 & c.Offset(, -11) & " - PO " & c.Offset(, -1) & " - Arrive à écheance le : " & c.Offset(, 0) & vbCrLf
End If
End If
Next c
If txt <> "" Then MsgBox txt, vbCritical, "ALERTE"
If txt1 <> "" Then MsgBox txt1, vbInformation, "INFORMATION"
End With
End Sub
Merci pour votre aide!
Pourriez-vous m'aider svp ?
Je cherche le bout de code supplémentaire qui me permettrai d'appliquer la macro ci-dessous uniquement aux lignes visibles (masquées via un bouton) de ma feuille.
Private Sub Worksheet_Activate()
Dim c As Range
txt = ""
txt1 = ""
With Sheets("Feuil1")
For Each c In Range(.[M5], [M65536].End(xlUp))
If c <> "" Then
If c.Value < Date Then
If txt = "" Then txt = "Dates échues:" & vbCrLf & vbCrLf
txt = txt & c.Offset(, -11) & " - PO " & c.Offset(, -1) & " - Terminée le : " & c.Offset(, 0) & vbCrLf
ElseIf c.Value < Date + 30 Then
If txt1 = "" Then txtl = "Dates arrivent à échéance:" & vbCrLf & vbCrLf
txt1 = txt1 & c.Offset(, -11) & " - PO " & c.Offset(, -1) & " - Arrive à écheance le : " & c.Offset(, 0) & vbCrLf
End If
End If
Next c
If txt <> "" Then MsgBox txt, vbCritical, "ALERTE"
If txt1 <> "" Then MsgBox txt1, vbInformation, "INFORMATION"
End With
End Sub
Merci pour votre aide!