#1   Report Post  
Posted to microsoft.public.excel.misc
Cheri
 
Posts: n/a
Default Formatting SSNs

I am trying to format a column of SSNs keeping any zeros in front and
dropping the hyphen. Can someone help me with this extra formatting?
Cheri
  #2   Report Post  
Posted to microsoft.public.excel.misc
Kevin B
 
Posts: n/a
Default Formatting SSNs

You can place the following custom function in a VBA module by pressing
Alt+F11 and then clicking on Insert and selecting module.
-------------------------------------------------------------------------------------------------
Function SSN(Value As Long) As String

Dim strVal As String
Dim i As Integer

strVal = CStr(Value)
i = Len(strVal)

Do Until i = 9
strVal = "0" & strVal
i = Len(strVal)
Loop

SSN = strVal

End Function
-------------------------------------------------------------------------------------------------
Save a backup copy of your file before proceeding.

You can use this function like any other function. If your in cell B1 and
the SS# is in A1 type "=SSN(A1)" sans quotes to convert the number SS# to a
text string. You can then copy the column of formulas and paste
special/Values over the original number.

Kevin Backmann


"Cheri" wrote:

I am trying to format a column of SSNs keeping any zeros in front and
dropping the hyphen. Can someone help me with this extra formatting?
Cheri

  #3   Report Post  
Posted to microsoft.public.excel.misc
Doug Kanter
 
Posts: n/a
Default Formatting SSNs


"Cheri" wrote in message
...
I am trying to format a column of SSNs keeping any zeros in front and
dropping the hyphen. Can someone help me with this extra formatting?
Cheri


What going to be done with these numbers after they're formatted this way?
That could be a factor in how you achieve your goal.


  #4   Report Post  
Posted to microsoft.public.excel.misc
dlw
 
Posts: n/a
Default Formatting SSNs


=CONCATENATE(LEFT(A1,3),MID(A1,5,2),RIGHT(A1,4))


"Doug Kanter" wrote:


"Cheri" wrote in message
...
I am trying to format a column of SSNs keeping any zeros in front and
dropping the hyphen. Can someone help me with this extra formatting?
Cheri


What going to be done with these numbers after they're formatted this way?
That could be a factor in how you achieve your goal.



  #5   Report Post  
Posted to microsoft.public.excel.misc
Cheri
 
Posts: n/a
Default Formatting SSNs

I understand the formula but if I put it into a cell, how do I get the SSN
into the cell - if I paste it, it removed the formula.

Cheri

"dlw" wrote:


=CONCATENATE(LEFT(A1,3),MID(A1,5,2),RIGHT(A1,4))


"Doug Kanter" wrote:


"Cheri" wrote in message
...
I am trying to format a column of SSNs keeping any zeros in front and
dropping the hyphen. Can someone help me with this extra formatting?
Cheri


What going to be done with these numbers after they're formatted this way?
That could be a factor in how you achieve your goal.





  #6   Report Post  
Posted to microsoft.public.excel.misc
dlw
 
Posts: n/a
Default Formatting SSNs

you enter the ssn's in column A, you put the formula in column B, format
column A as text so the leading zeors stay.

"Cheri" wrote:

I understand the formula but if I put it into a cell, how do I get the SSN
into the cell - if I paste it, it removed the formula.

Cheri

"dlw" wrote:


=CONCATENATE(LEFT(A1,3),MID(A1,5,2),RIGHT(A1,4))


"Doug Kanter" wrote:


"Cheri" wrote in message
...
I am trying to format a column of SSNs keeping any zeros in front and
dropping the hyphen. Can someone help me with this extra formatting?
Cheri

What going to be done with these numbers after they're formatted this way?
That could be a factor in how you achieve your goal.



  #7   Report Post  
Posted to microsoft.public.excel.misc
Doug Kanter
 
Posts: n/a
Default Formatting SSNs

As Kevin B mentioned in his message, you'll have to use two columns to make
this trick work. Or, you could hide the original SSNs on a second sheet in
the workbook, and put this formula (or Kevin's suggestion) in the column
where you want the jazzed up SSNs to appear. You'd have to adjust the two
suggestions so they point to the second sheet.

"Cheri" wrote in message
...
I understand the formula but if I put it into a cell, how do I get the SSN
into the cell - if I paste it, it removed the formula.

Cheri

"dlw" wrote:


=CONCATENATE(LEFT(A1,3),MID(A1,5,2),RIGHT(A1,4))


"Doug Kanter" wrote:


"Cheri" wrote in message
...
I am trying to format a column of SSNs keeping any zeros in front and
dropping the hyphen. Can someone help me with this extra formatting?
Cheri

What going to be done with these numbers after they're formatted this
way?
That could be a factor in how you achieve your goal.





  #8   Report Post  
Posted to microsoft.public.excel.misc
Cheri
 
Posts: n/a
Default Formatting SSNs

I am still having difficulty with this concatenate formula. I have a
spreadsheet I need to import as a flat file. First I have to put info into
an Excel spreadsheet. If I use the concat formula, it appears in a column
that I cannot have in my spreadsheet becasue the import parameters are
already set. Column A is my SSNs. I cannot use them in the import with
hyphens and if zeros drop off. Can anyone help me to format Column A so
zeros don't drop off and hyphens go away? I can use Column H for a formula.
Please answer with lower level geek speak. Thanks

"Cheri" wrote:

I am trying to format a column of SSNs keeping any zeros in front and
dropping the hyphen. Can someone help me with this extra formatting?
Cheri

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
Conditional Formatting Error ddate Excel Worksheet Functions 0 May 5th 05 09:00 PM
difficulty with conditional formatting Deb Excel Discussion (Misc queries) 0 March 23rd 05 06:13 PM
Formatting dates in the future Compass Rose Excel Worksheet Functions 3 January 17th 05 10:39 PM
Copy conditional formatting across multiple rows? Gil Excel Discussion (Misc queries) 1 January 11th 05 11:27 AM
Conditional formatting not available in Excel BAB Excel Discussion (Misc queries) 2 January 1st 05 03:33 PM


All times are GMT +1. The time now is 08:39 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"