test currency format of cell

  • Thread starter Thread starter hcacote
  • Start date Start date
H

hcacote

Hi,

I have several cells format as currency.

The cells can be of different currrencîes euro, dollars, british
pounds.

Is there a way to test if a cell is a different format?

I would like to use this information to later check the exchange rate
in a lookup table.

Thank you,
Hugo
 
First enter this tiny UDF:

Function txet(r As Range) As String
Application.Volatile
txet = r.Cells(1, 1).Text
End Function

This function converts the display value into a string. If A1 displays:

£12.34

then =txet(A1) will have the pound symbol as its first character. You can
use it in other formula:

=IF(LEFT(txet(A1),1)="$","dollars",IF(LEFT(txet(A1),1)="£","pounds","gok"))

You can use spreadsheet formulas to test for any currency symbol.
 
Back
Top