Format Textbox as currency

sharky12345

Well-known Member
Joined
Aug 5, 2010
Messages
3,404
Office Version
  1. 2016
Platform
  1. Windows
I'm trying to automatically format a textbox on a userform so that it displays currency but can't get it to do what I want.

As an example, if the user enters 12345 then I want the Textbox to display "£123.45". If they entered 1234 then I want the Textbox to display "£12.34".

I've got this so far but it's producing "£12,345":

VBA Code:
    If IsNumeric(TextBox1) Then
        TextBox1 = FormatCurrency(TextBox1, "0.00") 
    End If

Can someone assist?
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
How about
VBA Code:
    If IsNumeric(TextBox1) Then
        TextBox1 = FormatCurrency(TextBox1/100, "0.00") 
    End If
 
Upvote 0
How about
VBA Code:
    If IsNumeric(TextBox1) Then
        TextBox1 = FormatCurrency(TextBox1/100, "0.00")
    End If
Cheers Fluff - however, if I type '12345' I get "£123" - any ideas?
 
Upvote 0
Ok, how about
VBA Code:
TextBox1 = FormatCurrency(TextBox1 / 100)
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,213,528
Messages
6,114,154
Members
448,553
Latest member
slaytonpa

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