cs_tulesais
Messages postés175Date d'inscriptionmercredi 2 juin 2004StatutMembreDernière intervention11 avril 2013
-
29 sept. 2009 à 13:10
Calade
Messages postés1207Date d'inscriptiondimanche 20 avril 2003StatutMembreDernière intervention 4 juin 2016
-
29 sept. 2009 à 15:54
Bonjour tout le monde !!!
auriez vous une astuce pour simplifier le code et gagner en temps de réponse.
Pour encadrer une cellule, j'utilise le code suivant pour chaque cellule :
.Cells(LigneExcel, ColExcel).BorderAround ColorIndex:=vbBlack, Weight:=xlThin
Malheureusement, mon tableau étant assez énorme, la gestion d'une bordure pour chaque cellule est assez lourde (temps de réponse) !!!
Auriez vous une astuce pour générer cette bordure plus rapidement ?
j'ai essayé la commande ci-dessous mais cela me génère un cadre qui entoure la totalité des cellules et non pas un cadre pour chaque cellule :-(
cs_tulesais
Messages postés175Date d'inscriptionmercredi 2 juin 2004StatutMembreDernière intervention11 avril 20132 29 sept. 2009 à 15:33
Impec !!!
Merci beaucoup Calade !!!
Range(.Cells(1, 1), .Cells(LigneExcel, ColMax)).Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
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
Range("A1").Select