Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Currency change via vba
Help please . . . .
I want a user to be able to select a currency from a drop-down and the following macro will change certain cells to that currency. SO far it's working fine for £, EURO and ¥ (Pounds, Euros and Yen) but if it's changed to $ it does not appear to be working:- the cell's number formats are changed to £ (which is also my default currency format). Currency_Symbol = Worksheets("Invoice").Range("H6") Worksheets("Invoice").Range("I25:I42").NumberForma t = Currency_Symbol & "#,##0.00_);(" & Currency_Symbol & " #,##0.00)" Any help very much appreciated. Cheers! Steve |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Currency change via vba
|
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Currency change via vba
|
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Currency change via vba
Hi Claus
Thanks very much for that, it's plugged straight into my macro and worked a treat. Steve On Friday, 19 February 2016 18:50:33 UTC, Claus Busch wrote: Hi Steven, Am Fri, 19 Feb 2016 10:05:56 -0800 (PST) schrieb : Currency_Symbol = Worksheets("Invoice").Range("H6") Worksheets("Invoice").Range("I25:I42").NumberForma t = Currency_Symbol & "#,##0.00_);(" & Currency_Symbol & " #,##0.00)" modify the references: Sub Neu() Dim Currency_Symbol As String, myStr As String Currency_Symbol = Range("H1").Text myStr = IIf(Currency_Symbol = "$", "\", "") & Currency_Symbol & " #,##0.00;" _ & IIf(Currency_Symbol = "$", "\", "") & Currency_Symbol & " (#,##0.00)" Range("A1:A25").NumberFormat = myStr End Sub Regards Claus B. -- Vista Ultimate / Windows7 Office 2007 Ultimate / 2010 Professional |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Currency change via vba
Wow, this is really useful and convenient!
I myself am a stickler for formatting and consistency. I prefer the symbols aligned to the left. So I added an "*" inside Claus's formatting masks: ---- " * #,##0.00;" ---- " * (#,##0.00)" It make the figures visually more organized. Cheers, Mark |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Currency change via vba
|
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Currency change via vba
Thanks Mark, I shall follow your lead on that!
Steve |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Currency change via vba
Hi Steve,
Am Thu, 25 Feb 2016 10:24:20 -0800 (PST) schrieb : Thanks Mark, I shall follow your lead on that! please read also my last answer Regards Claus B. -- Vista Ultimate / Windows7 Office 2007 Ultimate / 2010 Professional |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Currency change via vba | Excel Programming | |||
change of currency in excel | Excel Discussion (Misc queries) | |||
CHANGE CURRENCY TO ZAR | Excel Worksheet Functions | |||
Currency change | Excel Discussion (Misc queries) | |||
Currency Change | Excel Programming |