currencies vba

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Currencies in VBA

Currencies in VBA

resolvedResolved · Low Priority · Version 2003

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?

Edited on Thu 27 Nov 2008, 11:46

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

Attached files...

CurrencyFormatting.doc

Thu 4 Dec 2008: Automatically marked as resolved.

 

Training courses

 

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Excel tip:

Applying and removing border from cell in Excel 2010

Did you know the shortcut key for applying and removing the outline border for a cell?

CTRL+SHIFT+& Applies the outline border to the selected cells.
CTRL+SHIFT_ Removes the outline border from the selected cells.

View all Excel hints and tips


Server loaded in 0.08 secs.