Bonjour à tous
Je voudrais dans cette macro quand un N° n'existe pas quelle puisse me le dire dans un MsgBox, que faut il mettre en plus dans la macro?
(VBA excel 2003)
Sub test()
Sheets("Feuil4").Select
Dim VCherchée As Integer
VCherchée = Application.InputBox(Prompt:="Selectionnez le numéro du jour souhaité")
Set Ma_Plage = Worksheets("Feuil4").Range("A2:A65500")
Nb_Ligne = Application.WorksheetFunction.CountA(Ma_Plage)
For i = 2 To Nb_Ligne
If Range("A" & i) = VCherchée Then
j = WorksheetFunction.CountIf(Range("D" & i & ": W" & i), ">0")
MsgBox "Il y a " & CStr(j) & " Appels reçus"
End If
Next i
Sheets("SAISIE").Select
End Sub
En remerciant tous ceux qui voudrons bien m'aider
Je voudrais dans cette macro quand un N° n'existe pas quelle puisse me le dire dans un MsgBox, que faut il mettre en plus dans la macro?
(VBA excel 2003)
Sub test()
Sheets("Feuil4").Select
Dim VCherchée As Integer
VCherchée = Application.InputBox(Prompt:="Selectionnez le numéro du jour souhaité")
Set Ma_Plage = Worksheets("Feuil4").Range("A2:A65500")
Nb_Ligne = Application.WorksheetFunction.CountA(Ma_Plage)
For i = 2 To Nb_Ligne
If Range("A" & i) = VCherchée Then
j = WorksheetFunction.CountIf(Range("D" & i & ": W" & i), ">0")
MsgBox "Il y a " & CStr(j) & " Appels reçus"
End If
Next i
Sheets("SAISIE").Select
End Sub
En remerciant tous ceux qui voudrons bien m'aider