Voici mon code :
Private Sub UserForm_Initialize()
Dim target As Range
Me.ListMe.List = Sheets("X").Range("d1", Sheets("X").Range("d1").End(xlDown)).Value
If Not Intersect(Range("C15,G15,K15"), target) Is Nothing Then
'If ActiveCell.Address = "$C$15" Or ActiveCell.Address = "$G$15" Or ActiveCell.Address = "$K$15" Then
Me.ListMe.MultiSelect = fmMultiSelectMulti
Else
Me.ListMe.MultiSelect = fmMultiSelectSingle
End If
Me.StartUpPosition = Manual
With ActiveCell
Me.Left = .Left + (1.5 * .Width)
Me.Top = .Top + (1 * .Height) - ActiveWindow.VisibleRange(1, 1).Top
End With
End Sub
Apres j'ai un msg d'erreur.
L'erreur me renvoie vers l'action double-clic en mettant en jaune Load userforme
If Not Intersect(Range("C15,G15,K15"), target) Is Nothing Then
With Range(ActiveCell.Offset(1, 0), ActiveCell.Offset(1, 0).End(xlDown))
.ClearContents
.Borders(xlEdgeLeft).LineStyle = xlNone
.Borders(xlEdgeRight).LineStyle = xlNone
.Borders(xlInsideHorizontal).LineStyle = xlNone
.Borders(xlEdgeBottom).LineStyle = xlNone
End With
[color=#FFFF00]Load Me[/color]
Me.Show
Cancel = True
End If
J'espère que c'est claire.