Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Simple VBA question (?)


Hi all, probably quite simple question, but I can't find the answer
......

In my Excel-application 4 pages (worksheets) exist: for example A,B,C
and D
Button on page A moves the user to page D
A similar button on page B navigates user also to page D

Now I wish to implement one button on page D "back" it should move
the user back to the originating page, i.e. where he began his journey.
In some cases he should go back to A, but sometimes to B.
How should Excel remember the starting page??

I tried Dim blabla as Name; blabla = Active.Worksheet.Name then
navigate to page D, then return to blabla. But the only thing happening
is lots of error messages.
I presume the solution could be simple? I am very grateful with an
answer!
Thanks,
Kees


--
Kees Korver
------------------------------------------------------------------------
Kees Korver's Profile: http://www.excelforum.com/member.php...o&userid=21562
View this thread: http://www.excelforum.com/showthread...hreadid=558249

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Simple VBA question (?)

Add this code to Thisworkbook (right click the excel icon next to file on the
Menu bar and select view code)...

Public wksLast As Worksheet

Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
Set wksLast = Sh
End Sub

Your Back code will look like this (placed in a sheet or standard code
module)...

Sub Back()
ThisWorkbook.wksLast.Select
End Sub

--
HTH...

Jim Thomlinson


"Kees Korver" wrote:


Hi all, probably quite simple question, but I can't find the answer
.....

In my Excel-application 4 pages (worksheets) exist: for example A,B,C
and D
Button on page A moves the user to page D
A similar button on page B navigates user also to page D

Now I wish to implement one button on page D "back" it should move
the user back to the originating page, i.e. where he began his journey.
In some cases he should go back to A, but sometimes to B.
How should Excel remember the starting page??

I tried Dim blabla as Name; blabla = Active.Worksheet.Name then
navigate to page D, then return to blabla. But the only thing happening
is lots of error messages.
I presume the solution could be simple? I am very grateful with an
answer!
Thanks,
Kees


--
Kees Korver
------------------------------------------------------------------------
Kees Korver's Profile: http://www.excelforum.com/member.php...o&userid=21562
View this thread: http://www.excelforum.com/showthread...hreadid=558249


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
simple sum question smiley61799 New Users to Excel 1 April 21st 09 04:58 PM
Simple question [email protected] New Users to Excel 4 March 24th 08 07:47 PM
IF formula-simple question; simple operator Rich D Excel Discussion (Misc queries) 4 December 6th 07 03:36 PM
Simple Simple Excel usage question BookerW Excel Discussion (Misc queries) 1 June 23rd 05 10:06 PM
simple question, hopefully a simple answer! Matt B Excel Programming 5 January 13th 04 08:43 PM


All times are GMT +1. The time now is 10:45 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"