MsgBox prompt to include TextBox4 value?

Big Lar

Well-known Member
Joined
May 19, 2002
Messages
554
Code:
If Trim(Me.TextBox4.Value) >= 7 Then<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
If MsgBox(Prompt:="Is #1 score correct?", Buttons:=vbYesNo) = vbNo Then<o:p></o:p>
Me.TextBox4.SetFocus<o:p></o:p>
Exit Sub<o:p></o:p>
Else<o:p></o:p>
End If<o:p></o:p>
End If
<o:p></o:p>
Is it possible for the MsgBox prompt to include TextBox4 value?
<o:p></o:p>
Example:
<o:p></o:p>
If TextBox4.Value equals 10,
<o:p></o:p>
MsgBox prompt equals “Is 10 correct for #1?”
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Try

Code:
If MsgBox(Prompt:="Is " & TextBox4.Value & " correct for #1?", Buttons:=vbYesNo + vbQuestion) = vbNo Then
 
Upvote 0
I belive this is what you are looking for

Code:
If Trim(Me.TextBox4.Value) >= 7 Then
If MsgBox(Prompt:="Is " & Trim(Me.TextBox4.Value) & " correct for #1?", Buttons:=vbYesNo) = vbNo Then
Me.TextBox4.SetFocus
Exit Sub
Else
End If
End If
 
Upvote 0
Leave it to an MVP to beat me to it! :biggrin:

We do our best :)

Also, since Text Boxes store values as text (!) I think that you need

Code:
If Val(Trim(Me.TextBox4.Value)) >= 7 Then

to convert to a number.
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,391
Members
448,957
Latest member
Hat4Life

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