Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    St. Charles, Illinois
    Posts
    222
    Thanks
    0
    Thanked 0 Times in 0 Posts

    macro to eliminate punctuation (Excel 2000)

    Is there a way to eliminate all punctuation in a cell including hyphens, commas, periods? I would like to eliminate the dashes for a social security number or a telephone number. Thank you.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: macro to eliminate punctuation (Excel 2000)

    The following macro will remove hyphens, periods, commas, semicolons and colons from selected cells. If you would like to remove other characters, you can add lines.

    Sub RemovePunctuation()
    Selection.Replace What:="-", Replacement:="", LookAt:=xlPart
    Selection.Replace What:=".", Replacement:="", LookAt:=xlPart
    Selection.Replace What:=",", Replacement:="", LookAt:=xlPart
    Selection.Replace What:=";", Replacement:="", LookAt:=xlPart
    Selection.Replace What:=":", Replacement:="", LookAt:=xlPart
    End Sub

  3. #3
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    St. Charles, Illinois
    Posts
    222
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: macro to eliminate punctuation (Excel 2000)

    Thank you for your assistance.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •