D
David F. Schrader
Hi to those willing to brave the length...
I have some data that has been entered, a 16 digit field formatted,
something like a Social Security Number. (It is suppose to look
like this: 5894 3710 0276 1002.) Of course, during the data
entry phase no one has followed the guide lines and now I am
trying to find a(n easy) way to reformat the data which is stored
in a column of an Excel spreadsheet.
At first I thought that simply going a "Replace" *All* might solve
the problem (see what I've included below which I culled out of a
macro I "recorded"). But Then I discovered that no two data entry
personnel offices had entered the data in the same columns. *ARGG*
(And of course there were other problems as well.)
My question is:
Does some one have a simple and more or less "clean" suggestion
that could be used with the
For Each cell_in_loop In Range("A2:A2000")
If cell_in_loop.Value = "EOList" Then
Exit For
End If
{
For each cell_in_loop.Offset(0, 9).Value
Perform the process each cell in the
column converting it to meet the "specs"
}
Next
I started off with the idea of a "Mid" but the code got way to long
and way to convoluted - I couldn't even figure out what I was trying
to do when I came back after I when home for a nights rest.
All help welcomed and appreciated.
David Schrader
*------
A code snipit
Application.ScreenUpdating = False
Cells.Replace What:="5894 37100", _
Replacement:="5894 3710 0", _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
Application.ScreenUpdating = False
Cells.Replace What:="5894 37109...", _
Replacement:="5894 37109...", _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
:
Trimmed
:
Cells.Replace What:="5894 3710 1", _
Replacement:="5894 3710 1", _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
:
Trimmed
:
Cells.Replace What:="5894 3710 9", _
Replacement:="5894 3710 - 9", _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
Application.ScreenUpdating = False
*------
I have some data that has been entered, a 16 digit field formatted,
something like a Social Security Number. (It is suppose to look
like this: 5894 3710 0276 1002.) Of course, during the data
entry phase no one has followed the guide lines and now I am
trying to find a(n easy) way to reformat the data which is stored
in a column of an Excel spreadsheet.
At first I thought that simply going a "Replace" *All* might solve
the problem (see what I've included below which I culled out of a
macro I "recorded"). But Then I discovered that no two data entry
personnel offices had entered the data in the same columns. *ARGG*
(And of course there were other problems as well.)
My question is:
Does some one have a simple and more or less "clean" suggestion
that could be used with the
For Each cell_in_loop In Range("A2:A2000")
If cell_in_loop.Value = "EOList" Then
Exit For
End If
{
For each cell_in_loop.Offset(0, 9).Value
Perform the process each cell in the
column converting it to meet the "specs"
}
Next
I started off with the idea of a "Mid" but the code got way to long
and way to convoluted - I couldn't even figure out what I was trying
to do when I came back after I when home for a nights rest.
All help welcomed and appreciated.
David Schrader
*------
A code snipit
Application.ScreenUpdating = False
Cells.Replace What:="5894 37100", _
Replacement:="5894 3710 0", _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
Application.ScreenUpdating = False
Cells.Replace What:="5894 37109...", _
Replacement:="5894 37109...", _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
:
Trimmed
:
Cells.Replace What:="5894 3710 1", _
Replacement:="5894 3710 1", _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
:
Trimmed
:
Cells.Replace What:="5894 3710 9", _
Replacement:="5894 3710 - 9", _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
Application.ScreenUpdating = False
*------