• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Trying to extract Currency Symbol from a cell

go2rishu

New Member
Hi, I have this requireemnt. I have to extract the currency Symbol, say USD or AED etc. from a cell and show it in another cell.


I tried assigning the result of ActiveCell.NumberFormat in to a String and then extracting only the first part of it till "]" using a While-Loop.


But it seems that, "_([$USD" is waht I get and the most difficult part is _ is a charecter but "($USD" all together acts like a SINGLe charecter. hence I'm not able to remove it.


Please let me know is there a bette way of extracting this Info.
 
This is the Code I've used


Dim cform, curform As String

cform = ""

cform = amt.NumberFormat 'amt is the source cell

i = 1

curform = ""

While Mid(cform, i, 1) <> "]"

curform = curform & Mid(cform, i, 1)

i = i + 1

Wend
 
I'm not sure what you're assignment requires, but you're able to do it without VBA which might make life a little easier. In another cell I would use the Find() formula to return the location of your search string. then I would put that location into a Mid() function like you've done above. In other words,


A1: $500 (USD)

B1: =MID(A1,FIND("USD", A1),3)


Let me know if that works for ya
 
Back
Top