Help with thousand and decimal separators

Joined
Aug 30, 2022
Messages
2
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
  5. 2013
Platform
  1. Windows
Hi, i'm having trouble with values in a textbox.
I have multiple textboxes that i need to enter/display currency values like the following for example: $100,000.00 I managed to enter/display only the comma separator for thousand, million, etc, but i cant find a way to enter/display the decimal separator (dot), the code i use for the comma separator and $ is the following:

VBA Code:
    TextBox1.Value = Format(TextBox1.Value, "$###,##")

Can anyone bring me some help with this?:(
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Welcome to the board.
Something like this?

VBA Code:
TextBox1.Value = Format(TextBox1.Value, "$#,##0.00")
 
Upvote 0
Welcome to the board.
Something like this?

VBA Code:
TextBox1.Value = Format(TextBox1.Value, "$#,##0.00")
Tried but it doesn't work like i imagined. To be more specific: in some textboxes i need to type values like "1,500.64" (for example), with
VBA Code:
TextBox1.Value = Format(TextBox1.Value, "$#,##")
the code puts automatically the comma separator but i aint able to put the dot for the decimals.
The one you give me only increments from 1.00 no matter which number i put:(
 
Upvote 0

Forum statistics

Threads
1,214,375
Messages
6,119,170
Members
448,870
Latest member
max_pedreira

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