Macro button that copies the last column of a table including their formulas onto the end of the table continuously?

Hasanul

New Member
Joined
Sep 7, 2023
Messages
6
Office Version
  1. 365
Platform
  1. Windows
I really need help (😭) to create a button that lets me continuously copy and paste columns from the end of a table. So each time I hit the button it will copy the last 2 columns and paste them into the next 2 columns and again and again using the same button.

I have been able to make a button that does it once (🥳) but then it copies the same cells and pastes in the same place it doesnt move across the table (🤔)

I have attatched two screenshots that hopefully help illustrate what I really need 🤖.

Really appreciate any help, thank you
 

Attachments

  • Shot 1.jpg
    Shot 1.jpg
    182.4 KB · Views: 11
  • Shot 2.jpg
    Shot 2.jpg
    233.5 KB · Views: 11
I suspect removing this line from your recorded code would've done the job:

I see where it fails, this should work:
VBA Code:
Sub Test2()
'
' Test2 Macro
'

'
Range("A2").Select
Selection.End(xlToRight).Select
Range(Selection.offset(,-1), Selection.End(xlDown)).Select
Selection.Copy
Selection.End(xlToRight).Select
Selection.End(xlToRight).Select
Range("XFD2").Select
Selection.End(xlToLeft).Select
Selection.Offset(,1).Select
ActiveSheet.Paste
End Sub
 
Upvote 0

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,215,123
Messages
6,123,183
Members
449,090
Latest member
bes000

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top