How do I add and then rename a worksheet using a macro?

G

Guest

When I try to rename a new worksheet in a macro, it will make the worksheet
but will not rename it.............. and gives an error because the new
worksheet has a different sheet number than the one the macro just made....

All I want to do is compile a macro that makes a new worksheet and will
rename that sheet a different name. . . . . . . .
 
E

Earl Kiosterud

Jerry,

The inserted worksheet will be the active sheet after the insert, so after
inserting it, you can write:

ActiveSheet.Name = "New Sheet"
 
B

Bob Phillips

Jerry,

Try

worksheets.Add.name="Bob"

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

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