Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 32
Default Conditionally formatting currency

In Excel 2003 Pro, is there any way of formatting currency in number format
conditionally - and how is it done?
For example, cell A1 can be « $ », « ‚¬ », or « £ ».
If cell A1 is « $ », then the contents of cell B1 should be formatted with a
$ sign whereas if A1 = « ‚¬ », then the contents of cell B1 should be
formatted with the ‚¬ sign and so on.
Thanks for any help

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default Conditionally formatting currency

Yendorian,

You can use the worksheet's change event. Copy the code below, right-click the sheet tab, select
"View Code", and paste the code into the window that appears. This assusmes that your cell A1
doesn't have the << and but just the currency symbols. Otherwise, you would need to clean up
the value from cell A1.

HTH,
Bernie
MS Excel MVP


Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address < "$A$1" Then Exit Sub
Range("B1").NumberFormat = Target.Value & "0.00"
End Sub


"Yendorian" wrote in message
...
In Excel 2003 Pro, is there any way of formatting currency in number format
conditionally - and how is it done?
For example, cell A1 can be « $ », « ? », or « £ ».
If cell A1 is « $ », then the contents of cell B1 should be formatted with a
$ sign whereas if A1 = « ? », then the contents of cell B1 should be
formatted with the ? sign and so on.
Thanks for any help



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 32
Default Conditionally formatting currency

Thanks for that. It works perfectly with the £ and ‚¬ sign but returns the ‚¬
sign again when it should be the $. Could this be because my computer is set
up with ‚¬ as the main currency?

"Bernie Deitrick" wrote:

Yendorian,

You can use the worksheet's change event. Copy the code below, right-click the sheet tab, select
"View Code", and paste the code into the window that appears. This assusmes that your cell A1
doesn't have the << and but just the currency symbols. Otherwise, you would need to clean up
the value from cell A1.

HTH,
Bernie
MS Excel MVP


Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address < "$A$1" Then Exit Sub
Range("B1").NumberFormat = Target.Value & "0.00"
End Sub


"Yendorian" wrote in message
...
In Excel 2003 Pro, is there any way of formatting currency in number format
conditionally - and how is it done?
For example, cell A1 can be « $ », « ? », or « £ ».
If cell A1 is « $ », then the contents of cell B1 should be formatted with a
$ sign whereas if A1 = « ? », then the contents of cell B1 should be
formatted with the ? sign and so on.
Thanks for any help




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default Conditionally formatting currency

Try finding a currency format that works for dollars, then record a macro to
get that string, and use it in the change event like:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address < "$A$1" Then Exit Sub
If Target.Value = "$" Then
Range("B1").NumberFormat = FORMAT STRING THAT WORKED HERE
Else
Range("B1").NumberFormat = Target.Value & "0.00"
End IF
End Sub



"Yendorian" wrote in message
...
Thanks for that. It works perfectly with the £ and ? sign but returns the
?
sign again when it should be the $. Could this be because my computer is
set
up with ? as the main currency?

"Bernie Deitrick" wrote:

Yendorian,

You can use the worksheet's change event. Copy the code below,
right-click the sheet tab, select
"View Code", and paste the code into the window that appears. This
assusmes that your cell A1
doesn't have the << and but just the currency symbols. Otherwise,
you would need to clean up
the value from cell A1.

HTH,
Bernie
MS Excel MVP


Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address < "$A$1" Then Exit Sub
Range("B1").NumberFormat = Target.Value & "0.00"
End Sub


"Yendorian" wrote in message
...
In Excel 2003 Pro, is there any way of formatting currency in number
format
conditionally - and how is it done?
For example, cell A1 can be « $ », « ? », or « £ ».
If cell A1 is « $ », then the contents of cell B1 should be formatted
with a
$ sign whereas if A1 = « ? », then the contents of cell B1 should be
formatted with the ? sign and so on.
Thanks for any help






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
Conditionally Formatting phmckeever Excel Worksheet Functions 1 August 25th 06 03:00 PM
Conditionally Formatting/Code Only One Word in a Formula kdlilly Excel Worksheet Functions 1 August 10th 06 04:35 PM
Conditionally formatting rows junoon Excel Worksheet Functions 4 May 29th 06 10:36 PM
Conditionally formatting highest valued cell? brett Excel Worksheet Functions 10 December 22nd 05 08:30 AM
Conditionally formatting other cells? brett Excel Worksheet Functions 3 December 20th 05 11:09 PM


All times are GMT +1. The time now is 12:22 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"