PDA

View Full Version : IF Statement on Cell Format



wz72n01
04-28-2009, 07:30 AM
I have a column that has a mix between US and Euro currency formats. I want to create a new column that will check to see if a cell is in Euro, and if so, will apply an exchange rate. The purpose is to have the final column all in US Dollar.

Any thoughts?:dunno

lenze
04-28-2009, 08:24 AM
Check to see what your styles are? You may need to create a Custom style for Euro's. You can then use a simple macro. Something like

Sub ConvertMe()
Dim cl as Range
For Each cl in Selection
If cl.Style = "Euro" Then Cells(cl.Row,cl.Column +1) = 1.056 'exchange rate
Next cl
End Sub
You can also use a Range or defined Name for your exchange rate


If cl.Style = "Euro" Then Cells(cl.Row,cl.Column +1) = Range("exchangeRate")HTH
lenze

wz72n01
04-28-2009, 10:48 AM
thanks lenze