I'm having trouble with an error msg.
At the time of my error it displays the msg I want but then finish out the routine. I can't figure out how to keep it open. I am using this code:
Private Sub CommandButton2_Click()
If cells <> b10 then
msgbox ("Incorrect numbers entered")
else
Transfer data
end if
Unload UserForm1
GetAns
End Sub
My problem is when the msgbox appears and I click okay the sub continues past the transfer data point and jumps the unload userform1 then getans. I need for the msg box to appear to notify of the error but allow me the chance to correct it, then transfer the data, then unload the userform, then getAns befor exiting the sub. Any ideas?
Thanks,
At the time of my error it displays the msg I want but then finish out the routine. I can't figure out how to keep it open. I am using this code:
Private Sub CommandButton2_Click()
If cells <> b10 then
msgbox ("Incorrect numbers entered")
else
Transfer data
end if
Unload UserForm1
GetAns
End Sub
My problem is when the msgbox appears and I click okay the sub continues past the transfer data point and jumps the unload userform1 then getans. I need for the msg box to appear to notify of the error but allow me the chance to correct it, then transfer the data, then unload the userform, then getAns befor exiting the sub. Any ideas?
Thanks,