Merci à tous pour vos propositions, vous êtes si rapides !
La proposition d'Eric Kergresse fonctionne bien, je n'ai pas eu le temps de regarder pour les autres propositions mais c'est certain que ça va fonctionner ! :)
PS: Oui j'ai remplacé le "For I = 1 To Sheets.Count" par "For I = 5 To Sheets.Count" !
J'en profite pou un problème dans le même genre, j'ai une macro qui me permet d'envoyer des mail selon une condition: "If Range("I" & i).Value >= 30"
J'aurais aimé afficher un Msgbox si jamais :" If Range("I" & i).Value < 30"
Seulement je ne sais pas où placer ce Msgbox => "MsgBox "la valeur étant inférieure à 30, RAS", vbOKOnly + vbCritical, "Excel"
Je poste un extrait de mon code ci-dessous:
Sub Envoi_Mail()
Dim i As Long, nom As String, chemin As String
Dim OutMail As Object
Dim S As Shape
Dim sRep As String, strbody As String, WshShell As Object
Dim xName As String
Dim xFound As Boolean
Application.ScreenUpdating = False
xName = InputBox("Veuillez saisir votre nom svp:", "Excel")
If xName = "" Then
MsgBox "Vérifiez la saisie svp.", vbOKOnly + vbCritical, "Excel"
Exit Sub
End If
If xName = "TOTO" Then
'***************************
Mon code VBA
'***************************
For i = 4 To Range("A" & Rows.Count).End(xlUp).Row
If IsEmpty(Range("H" & i).Value) Then
If Range("I" & i).Value >= 30 Then
'***************************
Mon code VBA
'***************************
End If
End If
Next
Else
MsgBox "Désolé, vous ne pouvez pas cliquer sur ce bouton.", vbOKOnly + vbCritical, "Excel"
End If
Application.ScreenUpdating = True
End Sub
Un grand merci à vous tous :)
JB