Code qui BUG sur Excel 2007

Boostez vos compétences Excel avec notre communauté !

Rejoignez Excel Downloads, le rendez-vous des passionnés où l'entraide fait la force. Apprenez, échangez, progressez – et tout ça gratuitement ! 👉 Inscrivez-vous maintenant !

jacky49

XLDnaute Impliqué
bonsoir le forum,
Voici un code qui me permet de faire des bordures et qui fonctionne sur EXCEL 2003 mais qui BUg sur EXCEL 2007 mais je ne sais pas pourquoi.
La ligne en jaune qui bug.
Merci
jacky


Code:
Public Sub CADRERPOULE(ByVal shtX As Object, ByVal Categ As String, ByVal Kol As Integer, ByVal Lig As Integer)
    
With shtX
    .Range(.Cells(Lig - 2, Kol + 2), .Cells(Lig - 1, Kol + 20)).ClearContents
    With .Range(.Cells(Lig - 2, Kol + 2), .Cells(Lig + 6, Kol + 20))
        .UnMerge
        '.ClearContents
        .Borders(xlEdgeLeft).LineStyle = xlNone
        .Borders(xlEdgeTop).LineStyle = xlNone
        .Borders(xlEdgeRight).LineStyle = xlNone
        .Borders(xlEdgeBottom).LineStyle = xlNone
        .Borders(xlInsideVertical).LineStyle = xlNone
        .Borders(xlInsideHorizontal).LineStyle = xlNone
    End With
        
        .Cells(Lig - 1, Kol).Value = "Dossard"
        .Cells(Lig - 1, Kol + 1).Value = "Arrivée"
        If UCase(.Name) = "FINALE" Then
            .Cells(Lig - 2, Kol).Value = "Finale " & Int((Kol + 1) / 3)
        Else
            .Cells(Lig - 2, Kol).Value = "Série " & (TOUR + 1) & "." & Int((Kol + 1) / 3)
        End If
        .Range(.Cells(Lig - 2, Kol), .Cells(Lig - 2, Kol + 1)).Merge
        If TOUR = 0 And Kol = 2 Then .Cells(Lig - 4, 1).Value = "Catégorie: " & Categ


    With .Range(.Cells(Lig - 2, Kol), .Cells(Lig - 1, Kol + 1))
        .Borders(xlEdgeLeft).LineStyle = xlDouble
        .Borders(xlEdgeRight).LineStyle = xlDouble
        .Borders(xlEdgeTop).LineStyle = xlDouble
        .Borders(xlEdgeBottom).LineStyle = xlDouble
        .Borders(xlInsideVertical).LineStyle = xlDouble
        .Borders(xlInsideHorizontal).LineStyle = xlDouble
    End With
    
    With .Range(.Cells(Lig, Kol), .Cells(Lig + 5, Kol + 1))
        [COLOR="Yellow"].Borders(xlEdgeLeft).LineStyle = xlDouble[/COLOR]
        .Borders(xlEdgeRight).LineStyle = xlDouble
        .Borders(xlEdgeTop).LineStyle = xlDouble
        .Borders(xlEdgeBottom).LineStyle = xlDouble
        .Borders(xlInsideVertical).LineStyle = xlDouble
        .Borders(xlInsideHorizontal).LineStyle = xlDash
    End With
    
End With
End Sub
 
Re : Code qui BUG sur Excel 2007

Bonjour Jacky49 🙂,
J'ai testé ta macro sur 2007 avec
Code:
Sub test()
Dim Feuille As Worksheet
Set Feuille = Sheets("Feuil1")
Call CADRERPOULE(Feuille, "Test", 3, 3)
End Sub
aucun souci rencontré. Je pense que ton fichier est indispensable pour trouver l'erreur...
Bonne soirée 😎
 
- Navigue sans publicité
- Accède à Cléa, notre assistante IA experte Excel... et pas que...
- Profite de fonctionnalités exclusives
Ton soutien permet à Excel Downloads de rester 100% gratuit et de continuer à rassembler les passionnés d'Excel.
Je deviens Supporter XLD

Discussions similaires

Réponses
4
Affichages
478
Réponses
35
Affichages
2 K
  • Question Question
Microsoft 365 worksheet_change
Réponses
29
Affichages
532
Réponses
2
Affichages
525
Réponses
3
Affichages
673
Retour