Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Excel Macro to take user back to page 1 before saving

I have a Workbook with 15 pages, the first page is a menu page with several
buttons to navigate through the workbook, on each other page I have a 'home'
button linking back to take the user back to the first page.

My problem arises when the user completes their task cliks on save and then
exits out of the Workbook (this process bypasses the links) - when they
return to the Workbook they are automaticlly taken to the last page they used
not page 1.

I would like a macro that will take the user back to the home page (Page1)
then save their work before exiting.

I have seen several macros that come close but I am unable to create the
correct one can someone help please.

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/comm...el.programming
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 611
Default Excel Macro to take user back to page 1 before saving

Rodney,

You could have a macro select your first sheet when it's opened (as long as
macros are enabled). This will select the first physical sheet (that's
visible):

Private Sub Workbook_Open()
Sheets(1).Activate
End Sub

Or you could use:

Private Sub Workbook_Open()
Sheets("Menu").Activate
End Sub

Substitute the sheet name for "Menu." Note that these are sheets, not
pages.
--
Earl Kiosterud
www.smokeylake.com

"Rodney" wrote in message
...
I have a Workbook with 15 pages, the first page is a menu page with several
buttons to navigate through the workbook, on each other page I have a
'home'
button linking back to take the user back to the first page.

My problem arises when the user completes their task cliks on save and
then
exits out of the Workbook (this process bypasses the links) - when they
return to the Workbook they are automaticlly taken to the last page they
used
not page 1.

I would like a macro that will take the user back to the home page (Page1)
then save their work before exiting.

I have seen several macros that come close but I am unable to create the
correct one can someone help please.

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow
this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/comm...el.programming



  #3   Report Post  
Posted to microsoft.public.excel.programming
pt pt is offline
external usenet poster
 
Posts: 4
Default Excel Macro to take user back to page 1 before saving

Use the following code. Sheets(1) can be replaced with Sheets("Menu") or
whatever your menu sheet is called.

Private Sub Workbook_BeforeClose(Cancel As Boolean)

Sheets(1).Activate
ThisWorkbook.Save

End Sub

"Rodney" wrote:

I have a Workbook with 15 pages, the first page is a menu page with several
buttons to navigate through the workbook, on each other page I have a 'home'
button linking back to take the user back to the first page.

My problem arises when the user completes their task cliks on save and then
exits out of the Workbook (this process bypasses the links) - when they
return to the Workbook they are automaticlly taken to the last page they used
not page 1.

I would like a macro that will take the user back to the home page (Page1)
then save their work before exiting.

I have seen several macros that come close but I am unable to create the
correct one can someone help please.

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/comm...el.programming

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
Saving Excel 2010 files as web page or single file web page Joe Artis Excel Discussion (Misc queries) 3 April 29th 23 03:44 AM
I saved my excel *.xls ,but I need to go back before saving. NICSO Excel Discussion (Misc queries) 1 October 6th 08 05:43 PM
Macro to Prompt User to Close After Saving Rutabaga Excel Discussion (Misc queries) 2 July 12th 07 12:38 AM
If I closed an excel doc without saving can I get it back? thx Unisom New Users to Excel 2 July 10th 06 09:34 PM
how do i get my orginal excel file back after saving over it dennis Excel Discussion (Misc queries) 2 July 3rd 06 08:01 AM


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