Private Sub CommandButton1_Click()
Const MCM_FIRST& = &H1000&, MCM_GETCURSEL& = (MCM_FIRST + 1&)
Dim LeTime As SYSTEMTIME
'Récuperer la date sélectionnée dans une cellule
SendMessage mWnd, MCM_GETCURSEL, 0&, LeTime
With LeTime
'MsgBox "Vous avez choisi le : " & vbNewLine & vbTab & _
Format(DateSerial(.wYear, .wMonth, .wDay), "dddd dd mmmm yyyy") & "."
Date2 = DateSerial(.wYear, .wMonth, .wDay)
'Récupérer la date sélectionnée dans une TextBox
If Not ObjetSource Is Nothing Then
If InStr(1, "Range,TextBox", TypeName(ObjetSource)) > 1 Then ObjetSource.Value = Date2
End If
End With
Unload Me
On Error Resume Next
Range("H2:H500").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=IF($E2>42000,Liste,"""")"
.IgnoreBlank = True
.InCellDropdown = True
.ShowInput = True
.ShowError = True
End With
Range("H2").Select
End Sub