View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default getting rif of apostrophe in front of ss#

use Edit=Replace

replace hyphens with nothing

the format the cells as you say.

--
Regards,
Tom Ogilvy

wrote in message
...
Thanks, I guess the format also includes dashes in between
the numbers like a normal social security number has but
the data in the cell shouldn't actually have the dashes it
should just appear that way with the ss# formatting. Can
I somehow eliminate the dashes from the text and then
format the remaining numbers with SS# format?

thank you
-----Original Message-----
Make a backup of your data before trying this....

Put this in a standard module:

Sub ElimApost()
Dim c As Range, f As String
If Not TypeOf Selection Is Range Then Exit Sub
For Each c In Selection
If c.PrefixCharacter = "'" Then c.Formula = c.Value
Next c
End Sub

Then highlight your ss#'s A10:A500

Tools, Macro, select ElimApost, and Run






"jrh" wrote in

message
...
I am trying to compare two lists by social security
number. However, one list has an apostrophe in front of
the ss# so the vlookup doesn't work. how do i get rid

of
the apostrophe and make the format the same as the other
ss#?

thank you



.