Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
jrh jrh is offline
external usenet poster
 
Posts: 14
Default getting rif of apostrophe in front of ss#

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default getting rif of apostrophe in front of ss#

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default getting rif of apostrophe in front of ss#

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



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default getting rif of apostrophe in front of ss#

Instead of the VBA code, you could create a helper column (a clean empty
column to the right (Maybe a quick insert of one)) -- If your ss#'s are in
A5:A500 as '111-22-3333
in B5 enter =SUBSTITUTE(A5,"-","") and copy down to B500. This will
eliminate the dashes and the leading " ' ". At present B5:B500 is a
formula; highlight B5:B500 and Copy, then (without moving do an Edit
Paste-Special Value, OK Now B5:B500 are
Values -- Move them to A5:A500.


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



.



  #5   Report Post  
Posted to microsoft.public.excel.programming
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



.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I remove the apostrophe(') in front of zeros Tommy Excel Discussion (Misc queries) 3 October 23rd 09 07:44 AM
how do I get an apostrophe deleted from in front of all entries gayle Excel Discussion (Misc queries) 2 March 13th 07 03:00 PM
What does an apostrophe (') in front of a word mean? Youzhong Li Excel Worksheet Functions 2 May 31st 06 11:10 AM
why is an apostrophe in front of text mlu Excel Discussion (Misc queries) 6 March 20th 06 07:59 PM
How do I add an apostrophe in front of existing column in Excel? Carlah2 Excel Discussion (Misc queries) 2 December 7th 05 03:56 PM


All times are GMT +1. The time now is 10:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"