stella3000
New Member
- Joined
- Aug 16, 2009
- Messages
- 3
I’ve created the following macro (relative reference) and assigned it to a button in order to be applied on the first sheet (= “Jan”) :<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
Sub IP_III()
'
' IP_III Macro
' Macro recorded 18/08/2009 by brutsaj
'
'
ActiveCell.Rows("1:1").EntireRow.Select
Selection.Copy
Selection.Insert Shift:=xlDown
ActiveCell.Offset(0, 3).Range("A1").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "n"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "n"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "n"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "n"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "n"
ActiveCell.Offset(0, 4).Range("A1").Select
ActiveCell.FormulaR1C1 = "0"
ActiveCell.Offset(0, 4).Range("A1").Select
ActiveCell.FormulaR1C1 = "0"
ActiveCell.Offset(0, 4).Range("A1").Select
ActiveCell.FormulaR1C1 = "0"
ActiveCell.Offset(0, 3).Range("A1").Select
ActiveCell.Offset(0, -127).Range("A1:DI1").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
ActiveCell.Offset(0, -2).Range("A1").Select
Selection.Font.Italic = True
ActiveCell.FormulaR1C1 = "Insert Post Name"
ActiveCell.Offset(1, 0).Range("A1").Select
End Sub
I have a workbook that contains multiple sheets (for each month the same one) with exactly the same content. I want this macro to automatically be applied to the other sheets on the exact same location of the active cell on the first sheet.
How do I translate this to VBA code?<o></o>
Sub IP_III()
'
' IP_III Macro
' Macro recorded 18/08/2009 by brutsaj
'
'
ActiveCell.Rows("1:1").EntireRow.Select
Selection.Copy
Selection.Insert Shift:=xlDown
ActiveCell.Offset(0, 3).Range("A1").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "n"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "n"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "n"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "n"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "n"
ActiveCell.Offset(0, 4).Range("A1").Select
ActiveCell.FormulaR1C1 = "0"
ActiveCell.Offset(0, 4).Range("A1").Select
ActiveCell.FormulaR1C1 = "0"
ActiveCell.Offset(0, 4).Range("A1").Select
ActiveCell.FormulaR1C1 = "0"
ActiveCell.Offset(0, 3).Range("A1").Select
ActiveCell.Offset(0, -127).Range("A1:DI1").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
ActiveCell.Offset(0, -2).Range("A1").Select
Selection.Font.Italic = True
ActiveCell.FormulaR1C1 = "Insert Post Name"
ActiveCell.Offset(1, 0).Range("A1").Select
End Sub
I have a workbook that contains multiple sheets (for each month the same one) with exactly the same content. I want this macro to automatically be applied to the other sheets on the exact same location of the active cell on the first sheet.
How do I translate this to VBA code?<o></o>