ActiveX Input Format as currency with 2dp

JonReyno

Board Regular
Joined
Jun 8, 2009
Messages
130
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I have been trawling the web and Mr Excel for an answer, but everything I have tried doesn't work. I am creating a userform that users need to be able to add in monetary values. Below is how I have the textbox set up at the moment, but it's not doing what I want:

VBA Code:
Private Sub TextBox18_Change()
    TextBox18.Value = Format(TextBox18.Value, "###,##")
End Sub

If I wanted to enter the value 1,234.56 into the cell I can't. It will give me 1,234 but doesn't all the .56. So I have tried different variations on it, commonly "###,##0.00" but that keep giving me 1.00 as a result.

Does anyone have a stroke of genius that will help me out? I don't mind if the filed has £ at the front or not. Currently I have that outside the box, but it can be part of the solution if needs be.
 
That's OK, I appreciate your help. I have just muddled something together and didn't really think about making it into a proper form. Lessons learnt for next time. If there isn't a way to change it, then it'll have to stay as it is. I've put too much work in to unpick it now.
 
Upvote 0

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Forum statistics

Threads
1,214,847
Messages
6,121,911
Members
449,054
Latest member
luca142

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