Easy Macro Question

Balfin

Board Regular
Joined
Dec 29, 2005
Messages
119
Hi,

I'm trying to get a macro that will, among other things, create a copy of the active worksheet and place it at the end of the workbook. I tried recording this, but all I get is ActiveSheet.Copy After=Sheets (4), which is fine if I only have 4 sheets. However, I need to runs this a lot of times in the same file to so the end keeps moving further down. Is there a to do this?

Thanks.
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

al_b_cnu

Well-known Member
Joined
Jul 18, 2003
Messages
4,516
Hi,

Try:

ActiveSheet.Copy After=Sheets (Sheets.Count)


[Edit]

Actually it should be:
ActiveSheet.Copy After:=Sheets (Sheets.Count)
 

Balfin

Board Regular
Joined
Dec 29, 2005
Messages
119
Thanks for the help. I rigged it up to work with ActiveSheet.Copy After:=ActiveSheet since the last sheet will be the one I'm copying, but it's nice to know a better way to do it.
 

Forum statistics

Threads
1,141,596
Messages
5,707,300
Members
421,502
Latest member
PULBAG

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
Top