View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Martin Fishlock Martin Fishlock is offline
external usenet poster
 
Posts: 694
Default Prompting user to answer a question before saving and closing

Joel: Just a point to watch out for it is better to use the before save event
as this is picked up on the close event if the user has made changes as saves.

Tanya: You also need to deal with the processing the reply by putting the
answer somewhere.

Look at John suggestion and use an ok button and them use

activeworkbook.worksheet("Sheet1").range("a1") = the result.

--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Joel" wrote:

You need to add a workbook close subroutine. the function should be put in
the Thisworkbook object. go to any tab on the bottom of the worksheet and
right click. Select View Code. You will see the VBA Project window on the
left. double click on ThisWorkbook and paste the code show below. After it
works make changes as necessary.

Private Sub App_WorkbookBeforeClose(ByVal Wb as Workbook, _
Cancel as Boolean)
a = MsgBox("Do you really want to close the workbook?", _
vbYesNo)
If a = vbNo Then Cancel = True
End Sub


"JustBreathe" wrote:

Hi,

I would like for the users of my excel workbook to provide a percent
complete update before saving and closing the file. Is there a way to have a
custom dialog box pop up when they attempt to save or close? Can this box
ask them to select a percentage complete choice from either a drop down box
or radio button selection? I would appreciate any assistance in pointing me
in the right direction or getting me started on this idea I'm trying to
implement.

TIA,
Tanya