conditional formatting for currency

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.
 
D

davesexcel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top