MsgBox to include Textbox value???

Big Lar

Well-known Member
Joined
May 19, 2002
Messages
557
I'm using this to display a Message Box

Code:
[FONT=Verdana]If Trim(Me.TextBox10.Value) <> 0 Then<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>[/FONT]
[FONT=Verdana]If MsgBox(Prompt:="Cash is out of balance. Accept?", Buttons:=vbYesNo) = vbNo Then<o:p></o:p>[/FONT]
[FONT=Verdana]Exit Sub<o:p></o:p>[/FONT]
[FONT=Verdana]Else<o:p></o:p>[/FONT]
[FONT=Verdana]End If<o:p></o:p>[/FONT]
[FONT=Verdana]End If<o:p></o:p>[/FONT]
[FONT=Verdana]<o:p>[/FONT]
</o:p>
<o:p></o:p>
Can I code the MsgBox prompt to include the value of Textbox10? <o:p></o:p>
<o:p></o:p>
So if TextBox10 value is 4, the MsgBox prompt would read “Cash is out of balance by $4. Accept?”<o:p></o:p>
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Hi,

Try this:

Code:
[FONT=Verdana]If MsgBox(Prompt:="Cash is out of balance by $" & Textbox10.Value & ". Accept?", Buttons:=vbYesNo) = vbNo Then[/FONT]
 
Upvote 0

Forum statistics

Threads
1,224,541
Messages
6,179,418
Members
452,912
Latest member
alicemil

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