Bonjour,
J'ai besoin de votre aide.
Je voudrais que ma combobox accepte la saisie au format date et j'ai beau chercher je ne trouve pas la solution adaptée a mon soucis qui pour vous ne doit etre qu'une formalité.
Ci dessous le code :
Private Sub combobox_date_change()
'selection date
ComboBox_date = Format(ComboBox_date, "dd/mm/yyyy")
End Sub
Private Sub CommandButton1_Click()
'bouton OK
Dim combobox_date_change As Date
combobox_date_change = Format(ComboBox_date, "dd/mm/yyyy")
Dim w As Worksheet
Dim l As Double
Set w = Worksheets("Planning")
On Error Resume Next
l = Application.WorksheetFunction.Match(CDbl(combobox_date_change), w.Range("F:F"), 0)
On Error GoTo 0
If l = 0 Then
MsgBox "La date selectionnée n'a pas été trouvée dans le planning."
Exit Sub
End If
w.Activate
w.Cells(l, "F").Activate
Set w = Nothing
Unload Me
End Sub
Private Sub CommandButton2_Click()
'bouton Annuler
Unload Me
End Sub
Private Sub ToggleButton_btn_aujourdhui_Click()
Dim w As Worksheet
Dim l As Double
Set w = Worksheets("Planning")
On Error Resume Next
l = Application.WorksheetFunction.Match(CDbl(Date), w.Range("F:F"), 0)
On Error GoTo 0
If l = 0 Then
MsgBox "La date d'aujourd'hui n'a pas été trouvée dans le planning."
Exit Sub
End If
w.Activate
w.Cells(l, "F").Activate
Set w = Nothing
Unload Me
End Sub
J'ai besoin de votre aide.
Je voudrais que ma combobox accepte la saisie au format date et j'ai beau chercher je ne trouve pas la solution adaptée a mon soucis qui pour vous ne doit etre qu'une formalité.
Ci dessous le code :
Private Sub combobox_date_change()
'selection date
ComboBox_date = Format(ComboBox_date, "dd/mm/yyyy")
End Sub
Private Sub CommandButton1_Click()
'bouton OK
Dim combobox_date_change As Date
combobox_date_change = Format(ComboBox_date, "dd/mm/yyyy")
Dim w As Worksheet
Dim l As Double
Set w = Worksheets("Planning")
On Error Resume Next
l = Application.WorksheetFunction.Match(CDbl(combobox_date_change), w.Range("F:F"), 0)
On Error GoTo 0
If l = 0 Then
MsgBox "La date selectionnée n'a pas été trouvée dans le planning."
Exit Sub
End If
w.Activate
w.Cells(l, "F").Activate
Set w = Nothing
Unload Me
End Sub
Private Sub CommandButton2_Click()
'bouton Annuler
Unload Me
End Sub
Private Sub ToggleButton_btn_aujourdhui_Click()
Dim w As Worksheet
Dim l As Double
Set w = Worksheets("Planning")
On Error Resume Next
l = Application.WorksheetFunction.Match(CDbl(Date), w.Range("F:F"), 0)
On Error GoTo 0
If l = 0 Then
MsgBox "La date d'aujourd'hui n'a pas été trouvée dans le planning."
Exit Sub
End If
w.Activate
w.Cells(l, "F").Activate
Set w = Nothing
Unload Me
End Sub