Hi All,
I have this basic VBA to copy and paste formulas to lastrow when the data is populated. The template has now changed, even though this seems simple I can't figure out how to do this.
How do I copy the formula in cell (L2 to AG2) all the way do to the Last used row? Here is my current code that needed to be changed.
Sub PIT_9_US()
Sheets("PIT 9 - US").Select
Range("L2").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Selection.End(xlToLeft).Select
Selection.End(xlDown).Select
ActiveCell.Offset(0, 2).Range("A1").Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
End Sub
Imran
I have this basic VBA to copy and paste formulas to lastrow when the data is populated. The template has now changed, even though this seems simple I can't figure out how to do this.
How do I copy the formula in cell (L2 to AG2) all the way do to the Last used row? Here is my current code that needed to be changed.
Sub PIT_9_US()
Sheets("PIT 9 - US").Select
Range("L2").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Selection.End(xlToLeft).Select
Selection.End(xlDown).Select
ActiveCell.Offset(0, 2).Range("A1").Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
End Sub
Imran