Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 171
Default Replace Formatted Cell Contents

I have some mixed data formatting in a column, SSN. Some of it is in the
format Numeric, then formatted 000-00-0000, and some of it is in the Format
"123-45-6789". I need to make it all alike -- how do I proceed?
--
Dave
Temping with Staffmark
in Rock Hill, SC
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 171
Default Replace Formatted Cell Contents

Sorry, not too clear. Try again:

Some cells contain data like 13640681, formatted Special, SSN. Some files
contain data like 013-64-0681. These variants may occur for the same
individual. I need to sort the data to bring all of any individual's records
together, hence I need to convert all of one kind or the other to a format
that makes them all formatted the same.

I hope that's a bit clearer!
--
Dave
Temping with Staffmark
in Rock Hill, SC


"Dave Birley" wrote:

I have some mixed data formatting in a column, SSN. Some of it is in the
format Numeric, then formatted 000-00-0000, and some of it is in the Format
"123-45-6789". I need to make it all alike -- how do I proceed?
--
Dave
Temping with Staffmark
in Rock Hill, SC

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 171
Default Replace Formatted Cell Contents

<Some files -- of course I meant "Some CELLS" (sheesh, getting too old for
this <g!)
--
Dave
Temping with Staffmark
in Rock Hill, SC


"Dave Birley" wrote:

Sorry, not too clear. Try again:

Some cells contain data like 13640681, formatted Special, SSN. Some files
contain data like 013-64-0681. These variants may occur for the same
individual. I need to sort the data to bring all of any individual's records
together, hence I need to convert all of one kind or the other to a format
that makes them all formatted the same.

I hope that's a bit clearer!
--
Dave
Temping with Staffmark
in Rock Hill, SC


"Dave Birley" wrote:

I have some mixed data formatting in a column, SSN. Some of it is in the
format Numeric, then formatted 000-00-0000, and some of it is in the Format
"123-45-6789". I need to make it all alike -- how do I proceed?
--
Dave
Temping with Staffmark
in Rock Hill, SC

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Replace Formatted Cell Contents

This macro will convert a group of mixed text and numeric SSN# into pure text:

Sub social()
Dim s As String
For Each r In Selection
s = r.Text
r.Clear
r.NumberFormat = "@"
r.Value = s
Next
End Sub


just Select & run.
--
Gary''s Student - gsnu200719


"Dave Birley" wrote:

I have some mixed data formatting in a column, SSN. Some of it is in the
format Numeric, then formatted 000-00-0000, and some of it is in the Format
"123-45-6789". I need to make it all alike -- how do I proceed?
--
Dave
Temping with Staffmark
in Rock Hill, SC

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 171
Default Replace Formatted Cell Contents

Magnificent -- worked like a bleedin' charm!
--
Dave
Temping with Staffmark
in Rock Hill, SC


"Gary''s Student" wrote:

This macro will convert a group of mixed text and numeric SSN# into pure text:

Sub social()
Dim s As String
For Each r In Selection
s = r.Text
r.Clear
r.NumberFormat = "@"
r.Value = s
Next
End Sub


just Select & run.
--
Gary''s Student - gsnu200719


"Dave Birley" wrote:

I have some mixed data formatting in a column, SSN. Some of it is in the
format Numeric, then formatted 000-00-0000, and some of it is in the Format
"123-45-6789". I need to make it all alike -- how do I proceed?
--
Dave
Temping with Staffmark
in Rock Hill, SC



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Replace Formatted Cell Contents

You are welcome. This is, unfortunately, a common real-world problem.
--
Gary''s Student - gsnu200719


"Dave Birley" wrote:

Magnificent -- worked like a bleedin' charm!
--
Dave
Temping with Staffmark
in Rock Hill, SC


"Gary''s Student" wrote:

This macro will convert a group of mixed text and numeric SSN# into pure text:

Sub social()
Dim s As String
For Each r In Selection
s = r.Text
r.Clear
r.NumberFormat = "@"
r.Value = s
Next
End Sub


just Select & run.
--
Gary''s Student - gsnu200719


"Dave Birley" wrote:

I have some mixed data formatting in a column, SSN. Some of it is in the
format Numeric, then formatted 000-00-0000, and some of it is in the Format
"123-45-6789". I need to make it all alike -- how do I proceed?
--
Dave
Temping with Staffmark
in Rock Hill, SC

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 171
Default Replace Formatted Cell Contents

So, here it is over 2 months later, and I think it is time for me to expand
my "Thanks". I now have a hidden WB called "Public Macros", and a slightly
modified version of your "Social" macro is the most frequently used member of
that file's citizens. Here is my modest little tweak:

Public Sub Social()
'
' Social Macro
'
Dim s As String
For Each R In Range("C3", Range("C3").End(xlDown))
With R
s = .Text
z = .Font.Size
c = .Interior.ColorIndex
.Clear
.NumberFormat = "000-00-0000"
.Font.Size = z
.Value = s
With .Interior
.ColorIndex = c
.Pattern = xlSolid
End With
End With
Next

This macro has made cross-WB searching a whole gang better! Cannot thank you
enough.
End Sub
--
Dave
Temping with Staffmark
in Rock Hill, SC


"Gary''s Student" wrote:

This macro will convert a group of mixed text and numeric SSN# into pure text:

Sub social()
Dim s As String
For Each r In Selection
s = r.Text
r.Clear
r.NumberFormat = "@"
r.Value = s
Next
End Sub


just Select & run.
--
Gary''s Student - gsnu200719


"Dave Birley" wrote:

I have some mixed data formatting in a column, SSN. Some of it is in the
format Numeric, then formatted 000-00-0000, and some of it is in the Format
"123-45-6789". I need to make it all alike -- how do I proceed?
--
Dave
Temping with Staffmark
in Rock Hill, SC

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
Replace #VALUE! with contents of cell?? MOK Excel Worksheet Functions 1 March 16th 07 10:33 AM
REPLACE PART OF CELL WITH FORMATTED TEXT Manju Excel Worksheet Functions 8 December 27th 06 11:42 PM
I need help writing a macro to replace cell contents. (new to VB) Emoshag[_2_] Excel Programming 2 April 14th 05 07:47 AM
replace cell contents Nancy B Excel Worksheet Functions 2 March 16th 05 04:39 PM
How do I replace the contents of a cell with its value instead of. Jean Excel Worksheet Functions 1 March 3rd 05 08:53 PM


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