Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform Terminate
Hey Troops,
I would like to give the user the option to abort a Terminate (clicking the red X) if they choose. If there is data that the user input and they accidently terminate I was trying to give the user the choice to abort the close and run another sub but the form still closes and then runs the msgbox part of the code. here's my code, any help would be greatly appreciated!!: Private Sub UserForm_Terminate() If (Me.BusName.Value) = "" Then Unload Me End If If (Me.BusName.Value) < "" Then Dim ua As String ua = MsgBox("Do you wish to save the current data entered on this form?", vbYesNo) If ua = vbYes Then Exit Sub Else If ua = vbNo Then Unload Me End If End If End If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Terminate Excel with a Macro??? | Excel Programming | |||
terminate a form | Excel Discussion (Misc queries) | |||
terminate a runnig macro | Excel Programming | |||
Macros terminate early | Excel Programming | |||
Can't terminate the excel instance from VB | Excel Programming |