copying and renaming a worksheet

M

Matthew Donnelly

What is the VB code for making a copy of an excel worksheet and renaming
it to "total"?

M. Donnelly




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
P

Pete McCosh

Matthew,

there may be a simpler way, but I usually just take
advantage of the fact that the copied sheet automatically
becomes the activesheet:

Sheets("Sheet A").Copy
Activesheet.name:="Total"

Cheers, Pete
 
J

John Pritchard

You'll also need to specify After (or before) or .copy
will create a new workbook for the copied sheet.

Sheets("Sheet A").Copy After:=Activesheet

John P.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top