View Full Version : Solved: Find a sheet name
Hey,
I need assistance with writing the code to place the sheet name in a variable that is directly to the right of a sheet named Index.
Thanks
ron
Bob Phillips
06-05-2009, 07:42 AM
You can't have a sheet named Index, Excel rejects it.
Bob Phillips
06-05-2009, 07:45 AM
Sorry, that was juts my Excel playing up.
Try this
myVar = worksheets(worksheets("Index").index+1).name
Bob Phillips
06-05-2009, 07:47 AM
Bit of error checking might help
If Worksheets("Index").Index < Worksheets.Count Then
myVar = Worksheets(Worksheets("Index").Index + 1).Name
Else
MsgBox "Oops!"
End If
xld,
It works perfect, thanks
ron
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.