Creer des bordures à mon tableau

youki

XLDnaute Occasionnel
Bonjour,
je désire installer par macro des bordures à une partie de feuille excel, je pensais utiliser ce code:
Code:
With 
Range("B8:G" & derLig ).CurrentRegion ' ou derlig est ma dernière ligne
        .BorderAround xlContinuous, xlThin, xlAutomatic
    End With

Seulement cela ne fonctionne que partielement -> le cadre fait le tour de ma zone sans faire de tableau(croisillon interieur).
Mais surtout mon cadre englobe aussi une partie des cases se trouvant au dessus exemple B7, B6... se retrouvent avec une ligne à droite.
 

Moulinois

XLDnaute Occasionnel
Re : Creer des bordures à mon tableau

Bonjour,

Sélectionne ta zone puis :
Code:
With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlEdgeTop)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlEdgeBottom)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlEdgeRight)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlInsideVertical)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlInsideHorizontal)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
@+
 

Discussions similaires

N
  • Question
Réponses
11
Affichages
1 K
nimbus le truand
N

Statistiques des forums

Discussions
312 156
Messages
2 085 815
Membres
102 991
dernier inscrit
remyexcel