Message Box Userform

RJ1969

Board Regular
Joined
Sep 13, 2014
Messages
76
Hello everyone,
I need help please. I am trying to set a message box in one of the textbox in the userform. If you want I can send you the file. Pls. email me. Thank you.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Welcome to the Board!

Can you give a bit more clarification?

It might help to post the code you have now and indicate what you're after.
 
Upvote 0
Hi... OK. Textbox3 I have this code and I want to add a message box that will say "Please enter key #".

Code:
Private Sub Textbox3_Change()
'Textbox3.Value = UCase(Textbox3.Value)
'Textbox3.BackColor = 16777215
If Textbox3.Text <> "" Then
    sf = Split(Secflr, "|")
    'Debug.Print Trim(sf(Textbox3.ListIndex)) & " " & UBound(sf)
    TextBox4.Text = Trim(sf(Textbox3.ListIndex))
End If
lastln:
End Sub

Private Sub TextBox3_Enter()
Me.Textbox3.BackColor = &HFFFF&
End Sub
Private Sub TextBox3_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Me.TextBox3.BackColor = 16777215
End Sub
 
Last edited by a moderator:
Upvote 0
I'd probably use the Enter event:

Code:
Private Sub TextBox3_Enter()
MsgBox "Please enter key #"
Me.Textbox3.BackColor = &HFFFF&
End Sub
Private Sub TextBox3_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Me.TextBox3.BackColor = 16777215
End Sub

But that will get irritating pretty quick, so you might just want to use a label.
 
Upvote 0
Hi Smitty,
All i have to do is add the "Msg Box "Pls enter key #" and it did worked. Thank you!
Question though? Is there anyway to change the color font and size font in the msg box?
 
Upvote 0
Hello, I have created a userformwith a combobox with a dropdown list.
I am currently having trouble creating a combobox which performs searches as Itype into it.
For example if I type los then it will automatically searches anything that has"los" that is los alamitos, los angeles, calosaga, etc.

This is what code I have so far in the frmInputs as the name of my userform.

Const header = "C5,a"
Const mySheet = "Sheet1"

Private Sub CommandButton1_Click()
If UBound(headerArr) Mod 2 <> 1 Then MsgBox "Error in Cell Address& Header pair"
For a = 0 To (UBound(headerArr) - 1) / 2
Range(headerArr(a * 2)).Offset(0, 1) = InputBox(headerArr(a * 2 + 1),"Field Entry")
Next
End Sub
Private Sub cmdOK_Click()
headerArr = Split(header, ",")
Set sht = Worksheets(mySheet)
For a = 0 To (UBound(headerArr) - 1) / 2
sht.Range(headerArr(a * 2)) = Controls("TextBox" & (a + 1))
Next
End Sub

<!--[if !supportLineBreakNewLine]-->
<!--[endif]-->
 
Upvote 0

Forum statistics

Threads
1,214,819
Messages
6,121,727
Members
449,049
Latest member
MiguekHeka

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top