Currency Format for UserForm

Big Lar

Well-known Member
Joined
May 19, 2002
Messages
557
My UserForm fills a row of a worksheet with values.
The code returns calculated values back to some of the UserForm TextBoxes.

So, with this…<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p></o:p>
Code:
[FONT=Verdana][SIZE=1]Private Sub TextBox21_AfterUpdate()<o:p></o:p>[/SIZE][/FONT]
[FONT=Verdana][SIZE=1]Dim iRow As Long<o:p></o:p>[/SIZE][/FONT]
[FONT=Verdana][SIZE=1]Dim WS As Worksheet<o:p></o:p>[/SIZE][/FONT]
[FONT=Verdana][SIZE=1]Set WS = Worksheets("Sheet2")<o:p></o:p>[/SIZE][/FONT]
[FONT=Verdana][SIZE=1]iRow = WS.Cells(Rows.Count, 1) _<o:p></o:p>[/SIZE][/FONT]
[FONT=Verdana][SIZE=1].End(xlUp).Offset(0, 0).Row<o:p></o:p>[/SIZE][/FONT]
[FONT=Verdana][SIZE=1]<o:p></o:p>[/SIZE][/FONT]
[FONT=Verdana][SIZE=1]WS.Cells(iRow, 21).Value = TextBox21.Value<o:p></o:p>[/SIZE][/FONT]
[FONT=Verdana][SIZE=1]WS.Cells(iRow, 32) = WS.Cells(iRow, 21).Value[/SIZE][/FONT]
[FONT=Verdana][SIZE=1]<o:p></o:p>[/SIZE][/FONT]
[FONT=Verdana][SIZE=1][B]TextBox32.Value = WS.Cells(iRow, 32).Value * 0.25[/B]<o:p></o:p>[/SIZE][/FONT]
[FONT=Verdana][SIZE=1]<o:p></o:p>[/SIZE][/FONT]
[FONT=Verdana][SIZE=1]End Sub<o:p></o:p>[/SIZE][/FONT]
<o:p></o:p>
<o:p></o:p>
How do I get TextBox32.Value to display as currency???
Example: If WS.Cells(iRow, 32).Value is 400...TextBox32 will be displayed as $100.00
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Try
Code:
[B][SIZE=1]TextBox32.Value = FormatCurrency(WS.Cells(iRow, 32).Value * 0.25)[/SIZE][/B]
 
Upvote 0
Thanks mikerickson!

Over an hour of tinkering...
...solved in less than 3 minutes!

Much appreciated.
 
Upvote 0

Forum statistics

Threads
1,224,592
Messages
6,179,789
Members
452,942
Latest member
VijayNewtoExcel

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