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 33
| Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next
valeur = Target.Value
'charge un combobox
If Target.Row > 4 And Target.Row < [b65000].End(xlUp).Row + 1 Then
If Target.Column = 4 or Target.Column = 5 Then
With ActiveSheet.ComboBox1
.Clear
.Left = Target.Left
.Top = Target.Top
.Width = Target.Width
.Height = Target.Height
.AddItem ""
End With
'avec les animateurs dispo
If Target.Column = 4 Then
For Each cell In FEquipe.Range("c3:c" & FEquipe.[c65000].End(xlUp).Row)
ActiveSheet.ComboBox1.AddItem cell.Value & " " & cell.Value
Next cell
Else
'avec les dates dispo
For i = Feuil1.[k15] To Feuil1.[k16]
ActiveSheet.ComboBox1.AddItem Format((i), "dd mmm")
Next i
End If
ComboBox1.Value = valeur
ComboBox1.Visible = True
Else
ComboBox1.Visible = False
End If
End If
End Sub |
Partager