Bonjour
J'ai creer une macro automatique dans excell pour metre en forme un tableau.
j'aimerais l'adapter
Sub borduretableau()
'
' bordure du tableau résultat
'
Dim VAR As Integer
VAR = cells(2 , 1).value
Range("B5:I230").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
Range("G1").Select
End Sub
la ou le bas blésse c'est sur :
Range("B5:I230").Select
en fait 230 est une variable (appeler VAR qui peut prendre plusieurs valeurs de 1 a 230
j'ai essayé plusieurs solutions, mais cela me met une erreur a chaque fois.
apparament c'est un bug sur la maniére d'écrire avec range. et select
merci pour votre aide
Ðidier