PC Review


Reply
Thread Tools Rate Thread

Button to set different currencies

 
 
kafukalatrava
Guest
Posts: n/a
 
      3rd Mar 2009
Hi all,

I'm working in a spreadsheet with different currencies.

Is there a way to create buttons to change the format of a cell to a
different currency? I'd need 3 of them (for €, $ and £ )

thx
 
Reply With Quote
 
 
 
 
Bernard Liengme
Guest
Posts: n/a
 
      3rd Mar 2009
Begin by recording three macros: one for each currency. Here is mine for the
Euro

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 03/03/2009 by Bernard V Liengme
'
'
Range("A2").Select
Selection.NumberFormat = "[$?-2] #,##0.00"
End Sub

I edited this to become
Sub Euro()
ActiveCell.NumberFormat = "[$?-2] #,##0.00"
End Sub


Next use View | Toolbars | Forma to add three buttons to your worksheet
Assign one of your macros to each button as you make them
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"kafukalatrava" <(E-Mail Removed)> wrote in message
news:58997F97-7440-44FD-9324-(E-Mail Removed)...
> Hi all,
>
> I'm working in a spreadsheet with different currencies.
>
> Is there a way to create buttons to change the format of a cell to a
> different currency? I'd need 3 of them (for ?, $ and )
>
> thx



 
Reply With Quote
 
Stefi
Guest
Posts: n/a
 
      3rd Mar 2009
Hi Bernard,

I also tried to solve this problem, and for euro my Excel recorded
numberformat "[$€-2]# ##0,00"

Note the € sign!

In VBA
ActiveCell.NumberFormat = "["[$€-2]# ##0.00"
worked perfectly.

In your example € sign is replaced by ? (question mark). Did it produce €
sign on the worksheet?

I also recorded cell formatting to £, and it resulted in a nice £ 9999.99
format in the cell but it was recorded in the macro as "[$L-809]#,##0.00"
format code.
In VBA
ActiveCell.NumberFormat = "[$L-809]#,##0.00"

gave an ugly L 9999.99 format.

In no way I could produce £ 9999.99 format in the cell through VBA.

Do you know why? And how to overcome it?

Regards,
Stefi


„Bernard Liengme” ezt *rta:

> Begin by recording three macros: one for each currency. Here is mine for the
> Euro
>
> Sub Macro1()
> '
> ' Macro1 Macro
> ' Macro recorded 03/03/2009 by Bernard V Liengme
> '
> '
> Range("A2").Select
> Selection.NumberFormat = "[$?-2] #,##0.00"
> End Sub
>
> I edited this to become
> Sub Euro()
> ActiveCell.NumberFormat = "[$?-2] #,##0.00"
> End Sub
>
>
> Next use View | Toolbars | Forma to add three buttons to your worksheet
> Assign one of your macros to each button as you make them
> best wishes
> --
> Bernard V Liengme
> Microsoft Excel MVP
> http://people.stfx.ca/bliengme
> remove caps from email
>
> "kafukalatrava" <(E-Mail Removed)> wrote in message
> news:58997F97-7440-44FD-9324-(E-Mail Removed)...
> > Hi all,
> >
> > I'm working in a spreadsheet with different currencies.
> >
> > Is there a way to create buttons to change the format of a cell to a
> > different currency? I'd need 3 of them (for ?, $ and £ )
> >
> > thx

>
>
>

 
Reply With Quote
 
Bernard Liengme
Guest
Posts: n/a
 
      3rd Mar 2009
Yes I got the ? sign
Maybe it depends on the font being used
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Stefi" <(E-Mail Removed)> wrote in message
news:140A0AA0-4CFA-417D-8040-(E-Mail Removed)...
> Hi Bernard,
>
> I also tried to solve this problem, and for euro my Excel recorded
> numberformat "[$?-2]# ##0,00"
>
> Note the ? sign!
>
> In VBA
> ActiveCell.NumberFormat = "["[$?-2]# ##0.00"
> worked perfectly.
>
> In your example ? sign is replaced by ? (question mark). Did it produce ?
> sign on the worksheet?
>
> I also recorded cell formatting to , and it resulted in a nice 9999.99
> format in the cell but it was recorded in the macro as "[$L-809]#,##0.00"
> format code.
> In VBA
> ActiveCell.NumberFormat = "[$L-809]#,##0.00"
>
> gave an ugly L 9999.99 format.
>
> In no way I could produce 9999.99 format in the cell through VBA.
>
> Do you know why? And how to overcome it?
>
> Regards,
> Stefi
>
>
> "Bernard Liengme" ezt rta:
>
>> Begin by recording three macros: one for each currency. Here is mine for
>> the
>> Euro
>>
>> Sub Macro1()
>> '
>> ' Macro1 Macro
>> ' Macro recorded 03/03/2009 by Bernard V Liengme
>> '
>> '
>> Range("A2").Select
>> Selection.NumberFormat = "[$?-2] #,##0.00"
>> End Sub
>>
>> I edited this to become
>> Sub Euro()
>> ActiveCell.NumberFormat = "[$?-2] #,##0.00"
>> End Sub
>>
>>
>> Next use View | Toolbars | Forma to add three buttons to your worksheet
>> Assign one of your macros to each button as you make them
>> best wishes
>> --
>> Bernard V Liengme
>> Microsoft Excel MVP
>> http://people.stfx.ca/bliengme
>> remove caps from email
>>
>> "kafukalatrava" <(E-Mail Removed)> wrote in
>> message
>> news:58997F97-7440-44FD-9324-(E-Mail Removed)...
>> > Hi all,
>> >
>> > I'm working in a spreadsheet with different currencies.
>> >
>> > Is there a way to create buttons to change the format of a cell to a
>> > different currency? I'd need 3 of them (for ?, $ and )
>> >
>> > thx

>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Currencies Rockbear Microsoft Excel Worksheet Functions 1 10th Nov 2008 01:23 PM
SUM DIFFERENT CURRENCIES Irfan Microsoft Excel Worksheet Functions 2 10th Apr 2008 02:11 PM
SUM UP DIFFERENT CURRENCIES Irfan Microsoft Excel Worksheet Functions 4 9th Apr 2008 01:42 PM
different currencies =?Utf-8?B?QkFaWkE=?= Microsoft Excel Worksheet Functions 2 20th May 2005 01:15 PM
Two different currencies? Kostas Microsoft Access 2 29th Apr 2004 02:01 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:46 PM.