View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
BillyRogers BillyRogers is offline
external usenet poster
 
Posts: 78
Default Clean Up Phone and Fax Numbers

Here's a macro I have for cleaning up fax (or phone) numbers. Our sales
people enter all kinds of random items in the fax field and I use this to
take out all the extra info. I have three questions.

1. How can I take out the double quotation symbol?
2. How can I take out alphabetic characters without listing every single
letter? or is that possible?
3. Is there a better way to do this?

Thank you,
Billy Rogers
Dallas, TX

Sub CleanUP()
Dim c As Range

For Each c In Selection.Cells
c = Replace(c, " ", "")
c = Replace(c, "-", "")
c = Replace(c, ".", "")
c = Replace(c, ",", "")
c = Replace(c, "'", "")
c = Replace(c, "*", "")
c = Replace(c, ";", "")
c = Replace(c, "#", "")
c = Replace(c, "@", "")
c = Replace(c, "^", "")
c = Replace(c, "(", "")
c = Replace(c, ")", "")
c = Replace(c, "$", "")
c = Replace(c, "%", "")
c = Replace(c, "_", "")
c = Replace(c, "\", "")
c = Replace(c, "|", "")
c = Replace(c, "/", "")
c = Replace(c, "<", "")
c = Replace(c, "", "")
c = Replace(c, "?", "")
c = Replace(c, "!", "")
c = Replace(c, "+", "")
c = Replace(c, "`", "")
c = Replace(c, "~", "")
c = Replace(c, "&", "")
c = Replace(c, ":", "")
c = Replace(c, "[", "")
c = Replace(c, "]", "")
c = Replace(c, "{", "")
c = Replace(c, "}", "")



Next

End Sub