Macro to Copy Active Worksheet to End of Workbook

swampgirl

New Member
Joined
Nov 15, 2005
Messages
5
I've resisted posting for help on this, but after about the hundredth attempt and way too many hours searching the web for the code, I admit defeat.

All I want to do is create a macro that will copy the active worksheet (whichever it may be at that moment, although usually it will already be the last one) to the end of the workbook. I've tried relative references, monkeying with the VB script (unfortunately I don't go much further than the original BASIC in days of yore.... 10 PRINT "Hello!"), and at this point am tempted to give voodoo a whirl. I always end up with either the same sheet being copied no matter what is active, or one that isn't copied to the end of the workbook.

Help? Please please pretty please? Proverbial cherry on top and everything?

Thanks so much!
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Try this code:
put it in a module

Public Sub MoveActiveSheetToEndOfWorkbook()

Dim wksCurrent As Worksheet
Dim wksLast As Worksheet

For Each wksCurrent In Worksheets

Set wksLast = wksCurrent

Next wksCurrent

ActiveSheet.Move , wksLast
End Sub
 
Upvote 0
Hi...I appreciate your time and help! When I ran this it moved the sheet to the end of the workbook, but didn't create a copy that is moved to the end. Sorry if that wasn't completely clear in my original post....
 
Upvote 0
Well nevermind....I tried changing "Move" to copy in the module you gave me and it did exactly what I wanted. YAYY!!!

Thanks so much dtchan!
 
Upvote 0

Forum statistics

Threads
1,211,882
Messages
6,104,557
Members
447,915
Latest member
jpearson

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