Instead of a messagebox use a custom userform to show message. Not sure how to get the yes or no buttons right?
Instead of a messagebox use a custom userform to show message. Not sure how to get the yes or no buttons right?
Last edited by zplugger; 01-21-2017 at 01:30 PM.
In your attachment, the BeforeClose event interfered when I went to exit your workbook, so I deleted the BeforeClose event from my download of your file.
When posting attachments, it is customary to warn people if your file requires special handling for normal excel functionality. (Like opening and closing.)
I'm not sure why you need both Yes and No buttons for this. But if you put code like this in the user form's code module
Please Login or Register to view this content.
you can use the user form with code like this. Note that the syntax is similar to that for a MsgBox.
Please Login or Register to view this content.
Last edited by mikerickson; 01-21-2017 at 12:45 PM.
_
...How to Cross-post politely...
..Wrap code by selecting the code and clicking the # or read this. Thank you.
Thanks mikerickson
Guess I could just use OK to close the workbook. Not sure why I was thinking yes or no. Here is my code now,just want to call the userform instead of the messagebox. So OK would just save the workbook and exit. So what cose do I put on userform ok button and delete the workbook close event code for messagebox?
Please Login or Register to view this content.
I would use the built in MsgBox rather than a custom user form, unless there is a good reason for it.
They syntax for calling the user form and reading the user's response would be like in the second code that I posted above.
Thank You mikerickson for the help, got it working.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks