1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
Private Sub CB_OK2_Click()
Dim TheDate As Long, Index As Variant
TheDate = Range("A4")
With Worksheets("Planning")
Index = Application.Match(TheDate, .Range(.Cells(3, 1), .Cells(3, .Columns.Count)), 0)
If IsError(Index) Then
MsgBox "Résultat négatif. Rien trouvé.", _
vbOKOnly + vbInformation, _
"Résultat"
Else
MsgBox "La date '" & Format(TheDate, "dd/mm/yyyy") & "' existe. Elle est située en cellule '" & _
.Cells(3, Index).Address(0, 0) & _
"' de la plage de cellules.", _
vbInformation + vbOKOnly, _
"Résultat"
.Cells(3, Index).Select
End If
End With
End Sub |
Partager