currencies vba
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

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

Currencies in VBA

resolvedResolved · Low Priority · Version 2003

replyReply Fri 7 Nov 2008, 15:58Delegate Neil said...

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?

For upcoming training course dates see: Pricing & availability

replyReply Thu 27 Nov 2008, 11:43 Edited on Thu 27 Nov 2008, 11:46Trainer Stephen said...

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

replyReply Thu 27 Nov 2008, 11:51Trainer Stephen said...

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.

 

Please browse our web site to find out more about
excel training uk and other Microsoft training courses.

Excel tip:

Create a unique items table from a duplicating table

1. Ensure that your list has column headings
2. Select the entire list
3. From the menu bar, select DATA, FILTER, ADVANCED FILTER
4. Select "Filter the list, in place", and tick the "Unique Records Only" box
5. Click OK, filtered list appears.

View all Excel hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard