View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Gord Dibben[_2_] Gord Dibben[_2_] is offline
external usenet poster
 
Posts: 621
Default Recognize currency in a cell

I'm not sure about this.

How should Excel know the currency format for each cell of data imported?

If raw numbers, no format would be displayed.

If the data OP is grabbing comes in with different currency types displayed, I
would say the data is in Text form.

Maybe OP should be looking at LEFT and CODE functions??

=CODE(LEFT,A1) would return 163 for English Pound £

128 for Euro sign €

Of course OP would have to have a table with codes for all currency types
involved.

Easy enough to build one if that's the case.


Gord Dibben MS Excel MVP


On Fri, 3 Dec 2010 16:29:05 -0800 (PST), FSt1 wrote:

On Dec 3, 3:48*am, minimaster
wrote:
hmm..
formating can vary a lot..
there is a better way * *Typename

Sub testttt4()
* * Dim c As Range
' * *Set c = ActiveSheet.[A1]
* * For Each c In ActiveSheet.UsedRange
* * * * If TypeName(c.Value) = "Currency" Then
* * * * * * c.Select
* * * * * * MsgBox " selected cell is a currency cell"
* * * * * * exit sub
* * * * End If
* * Next c
End Sub


hi,
i took it that he was looking for different currency types not just
currency.

Perhaps the op will clarify for us.

Regards
FSt1