disable close if conditions are not met
The problem with doing this is if they can't get the correct number then they
can't close the sheet. Users will start rebooting like mad if they can't get
it closed. A better option is to in thisworkbook at the on_close event show a
warning that the sheet is not properly filled out and cancel the close
event... Something like this...
Private Sub Workbook_BeforeClose(Cancel As Boolean)
'Citeria not met in an if statement
If MsgBox("Not completed correctly...Would you like to try again?",
vbCritical + vbYesNo, "Error") = vbYes Then
Cancel = True
End If
End Sub
HTH
"Michelle K" wrote:
hi,
i am writing a worksheet in excel. i need to disable the close button on
both the window and the menu bar if a certain total has not been met (i.e. if
they haven't answered the minimun number of questions they shouldn't be able
to close the file)
how do i do this? if you think this can be done more efficiently in any
other office application let me know as well.
thanks,
michelle k
|