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

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
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,217,380
Messages
6,136,226
Members
450,000
Latest member
jgp19

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