MACRO TO RENAME SHEET !

J

Jay Dean

I have 2 Excel Workbooks -- Book1 and Book2.
I want a code that will rename Sheet1 of Book1 whatever the value in
cell A1 in Sheet2 of Book2 is.

Any assistance would be appreciated. Thanks!

Jay Dean
 
D

Don Guillett

try this
sheets("sheet1").name=workbooks("book1.xls").sheets("sheet2").range("a1")
 
G

GB

Does this work?

Workbooks("Book1").Sheets(1).Name =
Workbooks("Book2").Sheets(2).Range("A1").Value

GB
 
G

GB

Jay Dean said:
No, I tried it but it did not work.
Ahem - what happened? It works on my machine and Don Guillett posted almost
identical code.

BTW, you said that your spreadsheets are called Book1 and Book2. You may
have meant Book1.xls and Book2.xls. Have you put the correct names in?

GB
 

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