Bonjour a tous,
je me tourne une nouvelle fois vers vous pour essayer de corriger mon code VBA...
Il marche nickel sauf quand je fais un tri alphabétique avec mon tableau. Il me mets une erreur 9 sur Set zone = .ListRows(Target.Row - .Range.Row).Range
voila mon code:
Bonne soirée
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim zone As Range If Not Intersect(Target, Range("Cartes")) Is Nothing Then Cells.FormatConditions.Delete With Target.ListObject Set zone = .ListRows(Target.Row - .Range.Row).Range End With With zone.FormatConditions.Add(xlExpression, Null, "=LIGNE(" & zone.Cells(1).Address(False, False) & ")=" & ActiveCell.Row) .Interior.Color = 9420794 .Font.Bold = True zone.Font.Size = 14 End With Else Cells.FormatConditions.Delete End If End Sub
Partager