Bonsoir,
Je cherche à connaître comment mettre le nom de la dernière feuille utilisée, ou comme mon cas où toutes mes feuilles sont numérotées de 0 à l'infini, prendre le plus grand nombre.
Voici une macro faite pour insérer une ligne et justement prendre le contenu de la dernière feuille active à la ligne 6 :
Sub Macro7()
Sheets("recapitulatif").Select
Rows("5:5").Select
Selection.Insert Shift:=xlDown
Range("A5:AL5").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
Range("A5:AL5").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
Selection.Borders(xlInsideVertical).LineStyle = xlNone
ActiveCell.FormulaR1C1 = "='2'!R[1]C"
Range("A6:AL6").Select
End Sub
En réalité, ce qu'il me faut est à la fin :
--> ActiveCell.FormulaR1C1 = "='2'!R[1]C"
Range("A6:AL6").Select
Merci
Configuration: Windows XP Internet Explorer 6.0