nanotechno
Messages postés2Date d'inscriptiondimanche 10 décembre 2000StatutMembreDernière intervention 7 mai 2008
-
7 mai 2008 à 17:55
cs_MPi
Messages postés3877Date d'inscriptionmardi 19 mars 2002StatutMembreDernière intervention17 août 2018
-
7 mai 2008 à 23:39
Bonjour,
J'ai un problème sur ma macro.
Ma macro ci dessous est correcte. Cependant, elle ne marche que si je me positionne en A8 et puis que je réalise la macro.
Je m'explique, si je me mets en A15 par exemple, ma macro et plus précisement :
ActiveCell.FormulaR1C1 = "=R[-1]C+1" va être effectué en A15.
Je veux qu'avant d'effectuer ma macro même si mon curseur est en A15 ou A20 ou B24 ou..., il active la cellule A8 (lorsque j'effectue ma macro)
Comment faire?
Merci d'avance pour vos réponses.
Sub macro1()
ActiveCell.FormulaR1C1 = "=R[-1]C+1"
Range("A8:F8").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
Range("A8").Select
Selection.NumberFormat = "0"
End Sub