Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formating Cells in Excel

Status
Not open for further replies.

killapiller

Technical User
Sep 16, 2004
1
US
I am trying creat a custom format in Excel and I need to know what character to use to specify that the digit could be either alpha or numeric. What I want the cells to do is when I enter either 4444444444 or 44444444A4 it is displayed as 444-44-44444 or 444-44-444A4. I know that the expression ###-##-##### will work for the first set, but I am at a loss for what to use in the second.
 
Hi,

Check out the format in Format/Cells-Number Tab-Special Select Phone or SSN

Skip,

[glasses] [red]Be advised:[/red] When transmitting sheet music...
If it ain't baroque, don't fax it! [tongue]
 
IF, ISNONTEXT, ISNUMBER and TEXT(cell,"blah blah")

would do it if you have data from another cell (maybe hidden)

eg If(ISNUMBER(cell),TEXT(cell,"format",IF(ISNONTEXT(cell),cell,TEXT(cell,"other format")))

of course you could format the cell during a WorkSheet_Change event and inspect every digit - I do it for drawing numbers like PL12345
then dump the result as text. As long as it does not look like a date and auto-completes ......... when I code to format the cell as text after every change (I hot-desk too much to muck about with other peoples' settings)

Don't ya just luuuuuuuuuuuuuuuv M$?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top