Forum Discussion
macro to add rows How enter realtive reference after row inserted?
I need to add macro code between line inserts or use a DO while.
I am having trouble with copying info down the spreadsheet
Range("A5").Select Application.CutCopyMode = False ActiveCell.FormulaR1C1 = "=+R[-3]C" Range("A6").Select Application.CutCopyMode = False ActiveCell.FormulaR1C1 = "=+R[-3]C" Range("B6").Select Application.CutCopyMode = False ActiveCell.FormulaR1C1 = "=+R[1]C" Range("C6").Select Application.CutCopyMode = False ActiveCell.FormulaR1C1 = "=+R[1]C" Range("D6").Select Application.CutCopyMode = False ActiveCell.FormulaR1C1 = "=+R[1]C" Range("E6").Select Application.CutCopyMode = False ActiveCell.FormulaR1C1 = "=+R[-3]C" Range("F6").Select Application.CutCopyMode = False ActiveCell.FormulaR1C1 = "=+R[1]C" Range("A5:F6").Select Selection.Copy Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Range("H6").Select Application.CutCopyMode = False ActiveCell.FormulaR1C1 = "=+R[1]C*-1" Range("I7").Select ActiveCell.FormulaR1C1 = "=+RC[-1]*-1" Range("I6").Select ActiveCell.FormulaR1C1 = "=+RC[-1]*-1" Range("I6:I7").Select Selection.Copy Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Range("J6").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Range("I6").Select Application.CutCopyMode = False ActiveCell.FormulaR1C1 = " " Range("I7").Select ActiveCell.FormulaR1C1 = " " Range("A10").Select End Sub
Thanks
How do you modify Code for relative reference?
Range("B7").Copy Destination:=Range("B6")
Can formula be used in the loop?
Thanks