Claudy
XLDnaute Accro
Bonsoir, j'ai récupérer ce code ci dessous pour surligner la ligne de ma cellule active:
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)).Resize(Selection.Rows.Count).Interior.ColorIndex = 36
'Range(Cells(Target.Row, col1), Cells(Target.Row, col2)).Interior.ColorIndex = 36
End If
End Sub
ça fonctionne très bien sur la ligne, mais je voudrais aussi adapter pour la colonne...
Merci pour votre aide,
Claudy
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)).Resize(Selection.Rows.Count).Interior.ColorIndex = 36
'Range(Cells(Target.Row, col1), Cells(Target.Row, col2)).Interior.ColorIndex = 36
End If
End Sub
ça fonctionne très bien sur la ligne, mais je voudrais aussi adapter pour la colonne...
Merci pour votre aide,
Claudy