Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Shapes.Range(Array("Image 1", "ComboBox1", "ComboBox2", "ComboBox3")).Visible = False
End Sub
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
If Target.Row = 1 Then Exit Sub
Dim x, y
Cancel = True
x = Target.Offset(, 1).Left: y = Target.Offset(-1).Top
With Shapes("Image 1")
.Left = x: .Top = y: .Visible = True
End With
With ComboBox1 'Année
.Left = x + 3: .Top = y + 18: .Value = Year(Date): .Visible = True
.List = [""&ROW(2025:2035)]
End With
With ComboBox2 'Mois
.Left = x + 62: .Top = y + 18: .Value = Format(Month(Date), "00"): .Visible = True
.List = [RIGHT(ROW(101:112),2)]
End With
With ComboBox3 'Jour
.Left = x + 121: .Top = y + 18: ComboBox3 = "": .Visible = True
End With
End Sub
Private Sub ComboBox3_GotFocus()
Dim i%, dat As Date, jour$, a$(), n%
With ComboBox3 'Jour
If ComboBox1.ListIndex = -1 Or ComboBox2.ListIndex = -1 Then .Clear: Exit Sub
For i = 1 To 31
dat = DateSerial(Val(ComboBox1), Val(ComboBox2), i)
jour = Application.Proper(Left(Format(dat, "ddd"), 2)) & " " & Format(i, "00")
If Month(dat) = Val(ComboBox2) Then ReDim Preserve a(n): a(n) = jour: n = n + 1
Next
.List = a
End With
End Sub
Private Sub ComboBox3_Change()
Dim dat$
If ComboBox1.ListIndex = -1 Or ComboBox2.ListIndex = -1 Or ComboBox3.ListIndex = -1 Then ComboBox3 = "": Exit Sub
dat = Right(ComboBox3, 2) & "/" & ComboBox2 & "/" & ComboBox1
If IsDate(dat) Then ActiveCell = CDate(dat)
End Sub