Neil has attended:
Excel VBA Advanced course
Currencies in VBA
How do I fix the currency, so that someone gets the correct currency when they open my spreadsheet, even if their default currency is different?
RE: Currencies in VBA
Hi Neil
Thank you for your question.
I would suggest you create a procedure that runs when the worksheet opens. You could prompt the user to enter their name, or some other method of identification.
You could then use a select case statement to assign the relevant formatting.
The following code sets the selection to currency and then changes the symbol to the Euro
Selection.Style = "Currency"
Selection.NumberFormat = _
"_-[$€-2] * #,##0.00_-;-[$€-2] * #,##0.00_-;_-[$€-2] * ""-""??_-;_-@_-"
Note the key marker which sets the currency value to euro.
Regards
Stephen
RE: Currencies in VBA
Hi Neil
Thank you for your question.
I would suggest you create a procedure that runs when the worksheet opens. You could prompt the user to enter their name, or some other method of identification.
You could then use a select case statement to assign the relevant formatting.
I have attached a text document that contains the code required to format a number as currency in euros
Regards
Stephen