Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Easy one: Remembering previous sheet name
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Easy one: Remembering previous sheet name
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Easy one: Remembering previous sheet name
Don't know if this would be of help. Would using the Web Toolbar "Back"
button work? If you customize your Excel Toolbar, it's under the "Web" category. It may not be the best solution, but it appears to remember the last Hyperlink jump (...If Hyperlinking to your Home sheet is what you are doing). -- Dana DeLouis Using Windows XP & Office XP = = = = = = = = = = = = = = = = = "paul" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
transfer contents from a cell in previous sheet if the sheet is a | New Users to Excel | |||
Remembering lookups | Excel Worksheet Functions | |||
Copying the repeated data of the previous sheet to the next sheet | Excel Discussion (Misc queries) | |||
Remembering a value moving from one sheet to another | Excel Discussion (Misc queries) | |||
Remembering Data Values. | New Users to Excel |