Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
transfer contents from a cell in previous sheet if the sheet is a DarkNight New Users to Excel 1 September 9th 08 01:04 AM
Remembering lookups Aitchy Excel Worksheet Functions 2 June 13th 08 09:53 AM
Copying the repeated data of the previous sheet to the next sheet Sasikiran Excel Discussion (Misc queries) 1 September 25th 07 03:18 PM
Remembering a value moving from one sheet to another Hitesh_sethi Excel Discussion (Misc queries) 3 April 27th 06 01:26 AM
Remembering Data Values. Workle New Users to Excel 1 February 10th 05 06:58 AM


All times are GMT +1. The time now is 02:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"