Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
EJ EJ is offline
external usenet poster
 
Posts: 20
Default Can I run a message box Macro on Save in Excel?

I want to remind users of a workbook that they need to fill in a last updated
cell if they have made any amendments to the sheet.

Is there a way I can get a message to pop up when they go to save the
document so they have to input the 'Last Updated' date in the relevant column
before they save and exit. And if I'm feeling really evil, can I get it to
not allow them to exit unless they've done it?

ps I'm a total VBA novice!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Can I run a message box Macro on Save in Excel?


You need to go into the vba editor alt F11

goto the thisworkbook object in the project explorer, then choos
Workbook and the BeforeClose event

then you want the msgbox function or you could even just update th
cell automatically.

Hope this points you in the right direction.

Cheer

--
tony
-----------------------------------------------------------------------
tony h's Profile: http://www.excelforum.com/member.php...fo&userid=2107
View this thread: http://www.excelforum.com/showthread.php?threadid=54469

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default Can I run a message box Macro on Save in Excel?

You could as well automatically poputalete thet 'Last Updateted' cell
whenever you save the workbook.

That would be a lot easier!

Cheers,
--
AP

"EJ" a écrit dans le message de news:
...
I want to remind users of a workbook that they need to fill in a last
updated
cell if they have made any amendments to the sheet.

Is there a way I can get a message to pop up when they go to save the
document so they have to input the 'Last Updated' date in the relevant
column
before they save and exit. And if I'm feeling really evil, can I get it
to
not allow them to exit unless they've done it?

ps I'm a total VBA novice!



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Can I run a message box Macro on Save in Excel?

see Chip Pearson's introduction to events:
http://www.cpearson.com/excel/events.htm

the event you would use would be the beforeclose and/or the beforesave
events for the workbook.

--
Regards,
Tom Ogilvy


"EJ" wrote:

I want to remind users of a workbook that they need to fill in a last updated
cell if they have made any amendments to the sheet.

Is there a way I can get a message to pop up when they go to save the
document so they have to input the 'Last Updated' date in the relevant column
before they save and exit. And if I'm feeling really evil, can I get it to
not allow them to exit unless they've done it?

ps I'm a total VBA novice!

  #5   Report Post  
Posted to microsoft.public.excel.programming
EJ EJ is offline
external usenet poster
 
Posts: 20
Default Can I run a message box Macro on Save in Excel?

Thanks all.

I used the Before Save option in the end and wrote a suitably snotty
message. ha ha!

To automatically update the cells with the date would be great, but as
theres a 'Last Updated' cell on each line of a 500 line document and not
every line gets updated this wouldn't be applicable. A great idea for another
document though!


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Can I run a message box Macro on Save in Excel?


Well lots of ways to do that but an easy one to conceptualise ( and
fairly fool proof) with a simple spreadsheet.

On opening the workbook make a copy of the sheet and hide it. On
closing the workbook run down each line comparing the current value
with the corresponding value on the saved sheet, update the last
changed date as appropriate.

Gets sort of complicated if you change rows around and that sort of
thing then you need to use the cell change event. But these are usually
problematic for a beginner to debug.


Just to get you thinking.


--
tony h
------------------------------------------------------------------------
tony h's Profile: http://www.excelforum.com/member.php...o&userid=21074
View this thread: http://www.excelforum.com/showthread...hreadid=544696

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
keep getting an error message when I save my excel spreadsheet S Excel Discussion (Misc queries) 0 April 30th 08 09:09 PM
When i try to save my Excel file i got a message "Excel could not Amos New Users to Excel 0 March 11th 08 12:32 PM
Macro to Save without the Save Message Ellen G Excel Discussion (Misc queries) 4 February 23rd 07 08:52 PM
suppress Excel save message Ben Excel Programming 2 October 29th 05 03:54 PM
Getting message can't save all data in excel xls file Melody05 Excel Discussion (Misc queries) 2 June 29th 05 12:20 PM


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