Bonjour à tous,

Je tourne en rond depuis un bon moment car le code suivant parfois passe, parfois pas (ce qui rend les choses encore moins compréhensible pour moi).

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
Sub MEF()
 
Dim j As Integer 
Dim MaPlage As Range
Dim N As Long
 
    For j = 1 To 100
        If IsError(ThisWorkbook.Worksheets("Listes").Cells(j + 1, 17)) Then Exit For
        Set MaPlage = Range("Tous")
        With MaPlage
            .FormatConditions.Add Type:=xlExpression, Formula1:="=$D6="""""
            N = .FormatConditions.Count
            With .FormatConditions.Item(N).Borders(xlBottom)
                .LineStyle = xlNone
                .Color = RGB(230, 230, 256)
                .LineStyle = xlContinuous
                .Weight = xlThin
            End With
        End With
    Next j
 
End Sub
A l'execution, error 1004 juste après la ligne 13 - With .FormatConditions.Item(N).Borders(xlBottom)...

Je fouille le web depuis 1 semaine, nada

Quelqu'un(e) aurait déjà rencontré le problème ?
Merci d'avance pour votre aide