Determine if character is text or numeric?

E

Ed

Within a range, I have designators that should be in the format "B-123".
But I have occasions where the "-" was left out. I also have occasions
where there is an entire word there (ie: "Basic"). So I will run down the
column, setting the value of each cell into a string and check the second
character (Right (Left (strCell, 2), 1); if it's numeric, I need to replace
"B" with "B-". But I can't figure out how to check if that character is
text or numeric. Any help is appreciated.

Ed
 
F

Fredrik Wahlgren

Ed said:
Within a range, I have designators that should be in the format "B-123".
But I have occasions where the "-" was left out. I also have occasions
where there is an entire word there (ie: "Basic"). So I will run down the
column, setting the value of each cell into a string and check the second
character (Right (Left (strCell, 2), 1); if it's numeric, I need to replace
"B" with "B-". But I can't figure out how to check if that character is
text or numeric. Any help is appreciated.

Ed

There's an ISNUMBER function that you can use:
http://www.techonthenet.com/excel/formulas/isnumber.htm
/Fredrik
 
G

Guest

There is a function called isnumeric. You may have difficulty with the -
charachter as is numeric will see that as a negative sign...

HTH
 

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