Hi.
I have made a Macro that insert a new row below the Activerow, then its autofills from Cell E5 and down to the last row.
(the reason is that the E5 and down to lastrow has the same formula, and it autofills to make the formula change f.eks c5+d5 to be cc6+d6.)
This makro works, and it works well.
But i want the makro to insted Autofill from the activerow, and down to the new row below. Because then its easier to keep the background color. and font copy. (basicly want it to be a copy of the format in the line below, with the formula Autofilled.
(since the rows below the new inserted line auto-adjusts the formula)
But i cant seem to get the syntax correct.
'I use this to insert a new line:
Range("A" & (ActiveCell.Row)).Select
Selection.Offset(1).EntireRow.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
'And this to Autofill from E5 and down to the last row in Coloum A:
lastrow = Range("A" & Rows.Count).End(xlUp).Row
Range("E5").Copy Range("E5:E" & lastrow)
I have made a Macro that insert a new row below the Activerow, then its autofills from Cell E5 and down to the last row.
(the reason is that the E5 and down to lastrow has the same formula, and it autofills to make the formula change f.eks c5+d5 to be cc6+d6.)
This makro works, and it works well.
But i want the makro to insted Autofill from the activerow, and down to the new row below. Because then its easier to keep the background color. and font copy. (basicly want it to be a copy of the format in the line below, with the formula Autofilled.
(since the rows below the new inserted line auto-adjusts the formula)
But i cant seem to get the syntax correct.
'I use this to insert a new line:
Range("A" & (ActiveCell.Row)).Select
Selection.Offset(1).EntireRow.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
'And this to Autofill from E5 and down to the last row in Coloum A:
lastrow = Range("A" & Rows.Count).End(xlUp).Row
Range("E5").Copy Range("E5:E" & lastrow)