test currency format of cell

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
 
G

Gary''s Student

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.
 

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