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

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Hi,

Try:

ActiveSheet.Copy After=Sheets (Sheets.Count)


[Edit]

Actually it should be:
ActiveSheet.Copy After:=Sheets (Sheets.Count)
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,214,822
Messages
6,121,772
Members
449,049
Latest member
greyangel23

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