you'll have to set the variable at the module level
so it will retain it's value between calls
(top of the module before the 1st procedure)
if all the code is in 1 module then
dim sSheetName as string
sub goHome()
ssheetname=activesheet.name
sheets(1).activate
end sub
sub goBack()
if ssheetname ="" then beep else sheets(ssheetname).activate
end sub
else put in 1 of the modules and refer to it with a qualifier so vba
knows where to find it.
also make it public if it's in an object module.
Public sSheetName as String
sheet1.ssheetname = activesheet.name
keepITcool
< email : keepitcool chello nl (with @ and .)
< homepage:
http://members.chello.nl/keepitcool
"paul" wrote:
Sheets EAST WEST NORTH and SOUTH all have a GO HOME button
that switches over to the HOME sheet. But from HOME, I
later need to get back to the sheet that sent me HOME, so
I need to remember the sheet name.
I tried AAA=Activesheet.Name as part of the GO HOME
button, then in HOME: Sheets(AAA).Select to take me back,
but that doesn't work.
TIA
Paul