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

currencies vba

ResolvedVersion 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:

Copying Values Without Formulas in Excel 2010

If you want to copy the contents of a cell but don't want to copy the formula with it then use the following simple method:

Press Ctrl+C to copy the values in the cell. On the Home tab, click Paste and then click Paste Values.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.11 secs.