conditional formatting for currency

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to figure out a way to formulate or format a column to reflect
particular currencies based on that text located in another column (for
example, if Column A denotes USD or Euro, is there a a formula that will
apply that currency symbol to a value located in Column C or a way to
conditionally format Column C based on what is written in Column A)? I am
using Excel 2003. Thanks.
 
This seems to work ;insert the code into a WorkSheet module

Private Sub Worksheet_Change(ByVal Target As Range)
If Union(Range("$A1:$A12"), Target).Address = Range("$A1:$A12").Address
Then
If Target = "USA" Then
ActiveCell.Offset(-1, 2).Range("A1").Select

Selection.NumberFormat = "$#,##0.00"
ElseIf Target = "Euro" Then
ActiveCell.Offset(-1, 2).Range("A1").Select

Selection.NumberFormat = "#,##0.00 [$€-1]"
End If
End If
End Sub
 
Back
Top