View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Currency change via vba

Hi Steve,

Am Fri, 19 Feb 2016 10:05:56 -0800 (PST) schrieb :

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)"


try:

Sub Test()
Dim LRow As Long
'If the currency values are in column A and
'the changed currency is in A1

LRow = Cells(Rows.Count, 1).End(xlUp).Row
Range("A1").Copy
Range("A2:A" & LRow).PasteSpecial Paste:=xlPasteFormats
Application.CutCopyMode = False
End Sub


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional