Sheet Rename (day 2)

D

Darin Kramer

Guys...

Whats wrong with this vb...

Sub renmame_sheet()
Sheets("Master").Select
ActiveSheet.Name = Range("b2")
End Sub

I get a run time 1004 "application defined or object defined" error...??

*** Sent via Developersdex http://www.developersdex.com ***
 
D

DaveO

It should work, but could be better to change Range("B2") to Range("B2").Value.

Is there a sheet called "Master". If not, then this will cause problems.

Also, is Range("B2") empty? If it is then there is no way this can work as a
sheet always has to be cleed something
 
B

Bob Phillips

Do you have invalid values in B2, such as \, ? etc.? An y value that cannot
be used in a worksheet name.
 
D

DaveO

HTH.

I would suggest somekind of validation in your code to make sure that
Range("B2") is both populated and does not use any special characters, like
Bob P refers to.

Only an idea.
 

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