XL 2016 procédure qui ne fait rien

Bill73

XLDnaute Junior
bonjour,

je me casse les dents depuis quelques heures avec :

VB:
Public Sub Format_Ligne(feuille As String, ByVal lig As Integer, dbcol As Integer, fncol As Integer)
        
        Worksheets(feuille).Range(dbcol & lig & ":" & fncol & lig).Borders.LineStyle = 1
        Worksheets(feuille).Range(dbcol & lig & ":" & fncol & lig).Borders.Weight = xlMedium
        Worksheets(feuille).Range(dbcol & lig & ":" & fncol & lig).Borders.Color = RGB(230, 230, 230)
        Worksheets(feuille).Cells(lig, fncol).Borders(xlEdgeRight).Color = RGB(89, 89, 89)
        Worksheets(feuille).Range(dbcol & lig & ":" & fncol & lig).Borders(xlEdgeTop).Color = RGB(230, 230, 230)
        Worksheets(feuille).Range(dbcol & lig & ":" & fncol & lig).Borders(xlEdgeBottom).Color = RGB(89, 89, 89)
        If lig Mod 2 = 0 Then
            Worksheets(feuille).Range(dbcol & lig & ":" & fncol & lig).Interior.Color = RGB(232, 232, 232)
        Else
            Worksheets(feuille).Range(dbcol & lig & ":" & fncol & lig).Interior.Color = RGB(209, 209, 209)
        End If
End Sub

je voudrais avoir ce code en général avec appel type " Format_Ligne "Entrée", ligent, 2, 15 " , ligent étant une variable contenant un numéro de ligne, depuis plusieures feuilles.

si je mets ce code à chaque fois dans les différentes feuilles, ça marche, si je fais une procédure globale, rien ne se passe.

Si quelqu'un a une idée ?
 
Solution
ok
ajoute une mfc
la formule
=ET(NB.SI($B3:$H3;"*")>0;ET($B3<>"";OU($L3&$B3="";$M3<ANNEE(AUJOURDHUI()))))

et ca s'applique à
=$B$3:$B$1000;$L$3:$M$1000
démo résultat
demo4.gif

Discussions similaires

Réponses
8
Affichages
620
Réponses
1
Affichages
1 K