ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Message Box before Save (https://www.excelbanter.com/excel-programming/370121-message-box-before-save.html)

kajero

Message Box before Save
 

I have a specific template that I fill out for certain requests. When
hit “SAVE AS”, is there a way to create a message box that says, "Di
you review the market code" and then provides a check box that say
"no" or "yes". If it you click "yes," then the workbook could be saved
if you click "no" it would give you the opportunity to review your work
and do SAVE AS again. I only need this for one specific template; i
only needs to be saved there, not in the personal.xls. A message bo
like this would really help cut down on the errors as we have 7
variables and many of them differ only by one character.

I have a basic understanding of VBA code, SQL and macros. If anyon
could help me, I would appreciate it.


Thank

--
kajer
-----------------------------------------------------------------------
kajero's Profile: http://www.excelforum.com/member.php...fo&userid=3739
View this thread: http://www.excelforum.com/showthread.php?threadid=57077


Jim Jackson

Message Box before Save
 
How about a command button labeled "Save As" or whatever. The msgbox could
come up first and, if answered "Yes" then an inputbox could come up to allow
the "SaveAs" specs. The code following would then do the save.
--
Best wishes,

Jim


"kajero" wrote:


I have a specific template that I fill out for certain requests. When I
hit €śSAVE AS€ť, is there a way to create a message box that says, "Did
you review the market code" and then provides a check box that says
"no" or "yes". If it you click "yes," then the workbook could be saved,
if you click "no" it would give you the opportunity to review your work,
and do SAVE AS again. I only need this for one specific template; it
only needs to be saved there, not in the personal.xls. A message box
like this would really help cut down on the errors as we have 72
variables and many of them differ only by one character.

I have a basic understanding of VBA code, SQL and macros. If anyone
could help me, I would appreciate it.


Thanks


--
kajero
------------------------------------------------------------------------
kajero's Profile: http://www.excelforum.com/member.php...o&userid=37397
View this thread: http://www.excelforum.com/showthread...hreadid=570776



Tom Ogilvy

Message Box before Save
 
You could do it in the BeforeSave event.

See Chip Pearson's page on events for an overview

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

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim ans as Long
ans = MsgBox("Did you review the market code", vbYesNo)
if ans = vbNo then
msgbox "Please review the market code"
cancel = true
exit sub
end if
End Sub

--
Regards,
Tom Ogilvy

"kajero" wrote:


I have a specific template that I fill out for certain requests. When I
hit €śSAVE AS€ť, is there a way to create a message box that says, "Did
you review the market code" and then provides a check box that says
"no" or "yes". If it you click "yes," then the workbook could be saved,
if you click "no" it would give you the opportunity to review your work,
and do SAVE AS again. I only need this for one specific template; it
only needs to be saved there, not in the personal.xls. A message box
like this would really help cut down on the errors as we have 72
variables and many of them differ only by one character.

I have a basic understanding of VBA code, SQL and macros. If anyone
could help me, I would appreciate it.


Thanks


--
kajero
------------------------------------------------------------------------
kajero's Profile: http://www.excelforum.com/member.php...o&userid=37397
View this thread: http://www.excelforum.com/showthread...hreadid=570776




All times are GMT +1. The time now is 04:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com