Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Kim Kim is offline
external usenet poster
 
Posts: 284
Default How do I format a social security number to have no dashes?

I have a column in Excel with social security numbers and i need to make the
formatting so the number has no dashes in it. So for instance 111-11-1111,
should look like 11111111. Is there a quick way to format my column to look
like this??

Thanks

Kim
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,047
Default How do I format a social security number to have no dashes?

Hi Kim,

Copy this function and paste as a new Module (press Alt+F11)

use a function =digitsonly(a2)
hth
regards from Brazil
Marcelo
********************************************
Public Function DigitsOnly(sStr As String) As Variant
Dim oRegExp As Object

Set oRegExp = CreateObject("VBScript.RegExp")

With oRegExp
.IgnoreCase = True
.Global = True
oRegExp.Pattern = "\D"

DigitsOnly = oRegExp.Replace(sStr, vbNullString)
End With
End Function
********************************************



"kim" escreveu:

I have a column in Excel with social security numbers and i need to make the
formatting so the number has no dashes in it. So for instance 111-11-1111,
should look like 11111111. Is there a quick way to format my column to look
like this??

Thanks

Kim

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 430
Default How do I format a social security number to have no dashes?

Is your SIN a 9 digit number that has special formatting to include the
dashes or is it text that already physically includes the dashes? If its the
1st case just format as text.

"kim" wrote:

I have a column in Excel with social security numbers and i need to make the
formatting so the number has no dashes in it. So for instance 111-11-1111,
should look like 11111111. Is there a quick way to format my column to look
like this??

Thanks

Kim

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 430
Default How do I format a social security number to have no dashes?

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

Try this formula if it is all text.

"kim" wrote:

I have a column in Excel with social security numbers and i need to make the
formatting so the number has no dashes in it. So for instance 111-11-1111,
should look like 11111111. Is there a quick way to format my column to look
like this??

Thanks

Kim

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 180
Default How do I format a social security number to have no dashes?

Use a customer format. Format Cells, on the number tab select Custom in
the category list at the left. In the text box labeled 'Type' enter the
format: 000000000, then click OK.

"kim" wrote:

I have a column in Excel with social security numbers and i need to make the
formatting so the number has no dashes in it. So for instance 111-11-1111,
should look like 11111111. Is there a quick way to format my column to look
like this??

Thanks

Kim



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default How do I format a social security number to have no dashes?

If the hyphens are part of the number format (not part of the value), then
Select the range
format|cells|Number tab
custom category
type: 000000000
in the "Type:" box

If the hyphens are really part of the data (liked they were typed in), then
Select the range
edit|replace
what: - (hyphen)
with: (leave blank)
replace all

And apply that same custom format.

kim wrote:

I have a column in Excel with social security numbers and i need to make the
formatting so the number has no dashes in it. So for instance 111-11-1111,
should look like 11111111. Is there a quick way to format my column to look
like this??

Thanks

Kim


--

Dave Peterson
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
Format a cell with a custom number format Armor Excel Worksheet Functions 4 January 29th 06 11:25 PM
number format Ivan Excel Discussion (Misc queries) 2 October 14th 05 02:08 PM
Number format for Combobox MBlake Excel Discussion (Misc queries) 1 June 29th 05 03:25 AM
Convert Social Security text to number? Joe Excel Discussion (Misc queries) 2 June 27th 05 07:56 PM
How to format a number in Indian style in Excel? Victor_alb Excel Discussion (Misc queries) 2 December 21st 04 04:21 AM


All times are GMT +1. The time now is 02:09 PM.

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

About Us

"It's about Microsoft Excel"