MsgBox Replacement w/ an UserForm

  • Thread starter Thread starter Chuckles123
  • Start date Start date
C

Chuckles123

Bob,
Thanks.
Formatting is easier in a Form. Also, the 'Yes-No' buttons are no
applicable to the options that I am giving the user.
I would appreciate if you or someone could give me a few lines o
code.
Chuckles12
 
Hi,
I don't have code, but just a few details about MsgBox (see online help):
You have other buttons available in msgbox:
-vbOKOnly 0 Display OK button only.
-vbOKCancel 1 Display OK and Cancel buttons.
-vbAbortRetryIgnore 2 Display Abort, Retry, and Ignore buttons.
-vbYesNoCancel 3 Display Yes, No, and Cancel buttons.
-vbYesNo 4 Display Yes and No buttons.
-vbRetryCancel
So if want to display Abort,Retry,Ignore buttons with a Warning icon:
MsgBox "did Not Work!", vbAbortRetryIgnore + vbCritical, "TEST"
as you can see , you just have to add the vbMsgBoxStyle in the Buttons
parameter as in : vbAbortRetryIgnore + vbCritical

Would that be enough flexibility in your case?
But maybe you already know about that and it doesn't fit your needs.

Regards,
Sebastien
 
In a general module:

Dim ans as String
Sub showform
userform1.show
if and = "House" then

else


end if
End Sub


in the userform1 module

Private Sub commandbutton1_click()
ans = "House"
Unload Me
End Sub

Private Sub commandbutton2_click()
ans = "Cabin"
Unload Me
end sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top