USD Currency Format Regardless of Local Excel Version

excel_2010

New Member
Joined
Aug 23, 2016
Messages
2
Hello,

I'm creating a worksheet that will be used in various countries. I have a macro that converts local inputs into USD with the following code:

some_object.NumberFormat = "$0.0,,"

The problem is users with a UK specific version of Excel, for example, input in pounds and this code formats formats the number in pounds instead of dollars as it should. I assume it's because the $ in the format pulls the local default currency. Is there a way to override this in VBA so that the output always displays a dollar sign ($)?

Thank you for your help, and apologies if this topic has been covered; I didn't find it.
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Hi,


try changing your code to this: some_object.NumberFormat = "[$$]0.0,,"

Be aware: this will just override the currency sign but will NOT convert the local currency into a dollars!
 
Upvote 0

Forum statistics

Threads
1,216,081
Messages
6,128,696
Members
449,464
Latest member
againofsoul

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