Claudy
XLDnaute Accro
Bonjour à tous,
dans un classeur, j'ai cette procédure qui marche très bien pour une ligne sélectionnée:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim champ As Range
Dim col1 As Double
Dim col2 As Double
Set champ = Range("A2:K133000")
If Not Intersect(Range("A2:N133000"), Target) Is Nothing And Target.Count = 1 Then
champ.Interior.ColorIndex = xlNone
col1 = champ.Column
col2 = col1 + champ.Columns.Count - 1
Range(Cells(Target.Row, col1), Cells(Target.Row, col2)).Interior.ColorIndex = 36
End If
End Sub
Ma question: comment adapter ce code pour plusieurs lignes sélectionnées avec Ctrl ?
Merci d'avance,
Claudy
dans un classeur, j'ai cette procédure qui marche très bien pour une ligne sélectionnée:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim champ As Range
Dim col1 As Double
Dim col2 As Double
Set champ = Range("A2:K133000")
If Not Intersect(Range("A2:N133000"), Target) Is Nothing And Target.Count = 1 Then
champ.Interior.ColorIndex = xlNone
col1 = champ.Column
col2 = col1 + champ.Columns.Count - 1
Range(Cells(Target.Row, col1), Cells(Target.Row, col2)).Interior.ColorIndex = 36
End If
End Sub
Ma question: comment adapter ce code pour plusieurs lignes sélectionnées avec Ctrl ?
Merci d'avance,
Claudy