Bonsoir
refappel = datappel + Heurappel
Attention la concaténation ne se fait pas avec la signe + mais avec &
Voila un code bricolé te permet de chercher dans une colonne format dd/mm/yyyy hh:mm à l'aide de deux textbox
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| Private Sub UserForm_Initialize()
Me.TextBox1 = Format(TextBox1.Value, "dd/mm/yyyy")
Me.TextBox2.Value = Format(Me.TextBox2.Value, "hh:mm")
End Sub
Private Sub CommandButton1_Click()
Dim cell As Range
Dim plage As Range
Set plage = Sheets("feuil1").Range("A1:A" & [A65536].End(xlUp).Row)
codrecherché = CDate(CDate(TextBox1.Text) & " " & CDate(TextBox2.Text))
For Each cell In plage
If cell.Value = codrecherché Then
MsgBox ("la personne recherchée est ; " & Cells(cell.Row, 2))
End If
Next cell
End Sub |
Bonne soirée à toutes et à tous
Partager