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
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
You can't have a sheet named Index, Excel rejects it.
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
Sorry, that was juts my Excel playing up.
Try this
[vba]
myVar = worksheets(worksheets("Index").index+1).name
[/vba]
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
Bit of error checking might help
[vba]
If Worksheets("Index").Index < Worksheets.Count Then
myVar = Worksheets(Worksheets("Index").Index + 1).Name
Else
MsgBox "Oops!"
End If
[/vba]
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
xld,
It works perfect, thanks
ron