Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default 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
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Currency change via vba

Thanks Mark, I shall follow your lead on that!

Steve
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Currency change via vba [email protected] Excel Programming 0 February 19th 16 07:00 PM
change of currency in excel Maggie Excel Discussion (Misc queries) 1 July 25th 09 05:16 PM
CHANGE CURRENCY TO ZAR lpplumbers Excel Worksheet Functions 1 January 16th 09 01:11 PM
Currency change RBeau Excel Discussion (Misc queries) 3 April 27th 06 08:45 PM
Currency Change mamun316[_3_] Excel Programming 0 December 10th 05 05:52 PM


All times are GMT +1. The time now is 10:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"