Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Recognize currency in a cell

Hi,

I have a spreadsheet which uses different currencies when data are
imported. I'm looking for a method to recognize currency type used in
a cell, for example:

A1: €100 or $100, £100 and so on.

Many thanks.
Marcin
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Recognize currency in a cell

On Dec 2, 5:40*pm, Marcin P wrote:
Hi,

I have a spreadsheet which uses different currencies when data are
imported. I'm looking for a method to recognize currency type used in
a cell, for example:

A1: €100 or $100, £100 and so on.

Many thanks.
Marcin


hi
currency type is formating so that is what you would be looking for.
here is a do nothing sniplet that checks for
dollars US.

Sub checkformat()
If Range("B2").NumberFormat = "$#,##0.00" Then
MsgBox "Dollars"
Else
MsgBox "NOT Dollars"
End If
End Sub

you would need to find out what your other currency formats are and
check for each one perhaps in a loop or
something.

Regards
FSt1
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default Recognize currency in a cell

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
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Recognize currency in a cell

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
  #5   Report Post  
Posted to microsoft.public.excel.programming
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Recognize Cell Color and Sum Data accordingly Universal Pegasus - Chad Excel Discussion (Misc queries) 3 February 11th 10 12:24 AM
How to add new currency Symbol in Format/Cell/Currency NOORZAD Excel Discussion (Misc queries) 2 June 22nd 09 07:59 AM
Formula to recognize text only in a cell Jim May Excel Worksheet Functions 11 March 8th 06 12:40 AM
recognize the cell Michael Excel Discussion (Misc queries) 0 June 21st 05 01:29 PM
how do i automatically format a cell to only recognize the first w BMoneeTheMoneeMan Excel Discussion (Misc queries) 2 March 21st 05 07:39 PM


All times are GMT +1. The time now is 06:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"