Copy & Rename Worksheet

srdavisgb

Board Regular
Joined
Nov 5, 2011
Messages
51
Thanks in advance for your assistance...

I am populating information in a template in a worksheet with vlookups. I want to move a copy of the worksheet to a new workbook. I recorded the steps and have the following code:

Sheets(Template).Select
Sheets(Tempate).Move

The macro stops at this point. I think it is looking for a command to indicate where to move the worksheet.

How do I indicate a new workbook?

Also, I want to paste the vlookup values in the template copy so there is no link to the original workbook. Do I do this before the move or after? I want to preserve the vlookup values in the template. How would you recommend doing this?

Again, thanks for your assistance.
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Try like this

Code:
Sheets(Template).Copy
With ActiveSheet.UsedRange
    .Value = .Value
End With

The new workbook will be the active workbook and you will need to save it (manually or with code).
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,915
Members
452,366
Latest member
TePunaBloke

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