Hi guys,<o
></o
>
I wouldlike to create a copy and paste to last row macro on excel.<o
></o
>
<o
> </o
>
In my excelfile, sheet 1 is called table. Sheet two is called rolling table which will be aconsolidation of past tables.<o
></o
>
The tableswill have the same widths so from A2:BP2, whilst the length varies. I am tryingto use a lastrow function in excel but it’s not working.<o
></o
>
The aim offunction is to prevent operational risk. More added functionality is the macrodeleting a row based on the date for that row. I have to think this more carefully.<o
></o
>
<o
> </o
>
For nowthis is the code I have.<o
></o
>
<o
> </o
>
Much helpwould be appreciated<o
></o
>
<o
> </o
>
Sub RollingTable()<o
></o
>
' RollingTableMacro<o
></o
>
Dim Last_Row As Long<o
></o
>
Sheets("VA").Activate<o
></o
>
Last_Row = Range("A" &Rows.Count).End(xlUp).Row<o
></o
>
Range("B2:BP2").CopyRange("B2:BP" & Last_Row)<o
></o
>
Range(Selection,Selection.End(xlToRight)).Select<o
></o
>
Range(Selection,Selection.End(xlDown)).Select<o
></o
>
Selection.Copy<o
></o
>
Sheets("RollingTable").Select<o
></o
>
Last_Row = Range("A" &Rows.Count).End(xlUp).Row<o
></o
>
Range("B2:BP2").CopyRange("B2:BP" & Last_Row) <o
></o
>
End Sub<o
></o
>
<o
> </o
>
I wouldlike to create a copy and paste to last row macro on excel.<o
<o
In my excelfile, sheet 1 is called table. Sheet two is called rolling table which will be aconsolidation of past tables.<o
The tableswill have the same widths so from A2:BP2, whilst the length varies. I am tryingto use a lastrow function in excel but it’s not working.<o
The aim offunction is to prevent operational risk. More added functionality is the macrodeleting a row based on the date for that row. I have to think this more carefully.<o
<o
For nowthis is the code I have.<o
<o
Much helpwould be appreciated<o
<o
Sub RollingTable()<o
' RollingTableMacro<o
Dim Last_Row As Long<o
Sheets("VA").Activate<o
Last_Row = Range("A" &Rows.Count).End(xlUp).Row<o
Range("B2:BP2").CopyRange("B2:BP" & Last_Row)<o
Range(Selection,Selection.End(xlToRight)).Select<o
Range(Selection,Selection.End(xlDown)).Select<o
Selection.Copy<o
Sheets("RollingTable").Select<o
Last_Row = Range("A" &Rows.Count).End(xlUp).Row<o
Range("B2:BP2").CopyRange("B2:BP" & Last_Row) <o
End Sub<o
<o