Deleting dashes from Social Security Number

Echo

New Member
Joined
Dec 26, 2002
Messages
16
I have a column of social security numbers and I want to delete the dashes between the numbers so the social security number is just 123456789. When I use find and replace it works but if the social security number starts with a 0 I lose that leading zero. Please help.
 
You have to convert the SSN to TEXT by putting an apostrophe in front of the zero.

'0030033933

What method are you getting rid of the dashes?
 
Upvote 0
Ok, here we go Echo -- the following modification fixes the problem of numbers beginning with 0 ...

Code:
Sub yFixSSnumber()
    For Each cell In [C2:C250]
        cell.Value = WorksheetFunction.Substitute(cell.Value, "-", "")
        cell.NumberFormat = "000000000"
    Next
End Sub
[\CODE]
 
Upvote 0

Forum statistics

Threads
1,226,850
Messages
6,193,335
Members
453,790
Latest member
yassinosnoo1

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top