Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default how return to last used sheet?

Hi there!

in a worksheet_activate event I test a number of variables and then ask the
user if it want to continue. If not, the user should come back to the sheet
it came from, "the previous visited". The "previous method" doesn't work
since it take you back to the previous sheet "in index". The user have 10
sheets that could be the previous visited.

what method should I use?

Regards!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default how return to last used sheet?

You would have to use the workbook level events to set a variable to hold
the last sheet the user was on.

See Chip Pearson's page on Events:

http://www.cpearson.com/excel/events.htm

--
Regards,
Tom Ogilvy

"Rolando" wrote in message
...
Hi there!

in a worksheet_activate event I test a number of variables and then ask

the
user if it want to continue. If not, the user should come back to the

sheet
it came from, "the previous visited". The "previous method" doesn't work
since it take you back to the previous sheet "in index". The user have 10
sheets that could be the previous visited.

what method should I use?

Regards!




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default how return to last used sheet?

Rolando,

I think you need to manage it yourself. Add this to THisWorkbook, and then
you can use the variable PrevSeet, but note that you will need
ThisWorkbook.PrevSheet from your code.

Public PrevSheet As String

Private Sub Workbook_Open()
PrevSheet = ActiveSheet.Name
End Sub

Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
PrevSheet = Sh.Name
End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Rolando" wrote in message
...
Hi there!

in a worksheet_activate event I test a number of variables and then ask

the
user if it want to continue. If not, the user should come back to the

sheet
it came from, "the previous visited". The "previous method" doesn't work
since it take you back to the previous sheet "in index". The user have 10
sheets that could be the previous visited.

what method should I use?

Regards!




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
Sheet selected, automatic return to top of sheet MIKEY Excel Worksheet Functions 7 March 9th 10 10:58 AM
lookup single value in one sheet, return multiple results from theother sheet Chuck[_3_] Excel Worksheet Functions 1 April 4th 08 06:17 AM
return last value of a sheet widman Excel Discussion (Misc queries) 4 May 24th 07 01:59 AM
Return to sheet Ed Davis Excel Worksheet Functions 7 April 11th 07 12:00 PM
How can I cause a cell to return the sheet name i.e. sheet 1? Matt Excel Worksheet Functions 2 February 15th 05 08:38 PM


All times are GMT +1. The time now is 06:57 PM.

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

About Us

"It's about Microsoft Excel"