View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
eliano[_2_] eliano[_2_] is offline
external usenet poster
 
Posts: 79
Default Spliting rather mixed up address

On 19 Giu, 23:42, Jeffery B Paarsa wrote:
Any code or macro already avilable anywhere to download or purchase?
--
Jeff B Paarsa


Hi Jeff,
I believe that you problem have not an easy solution; however try:

First split your data using Text in Column
Then try to construct your DB with this macro:

Option Explicit

Private Sub Worksheet_BeforeDoubleClick(ByVal _
Target As Range, Cancel As Boolean)
Cancel = True
Dim C As Long, R As Long, X As Long
C = Target.Column
R = Target.Row
C = C - 1
For X = C To 1 Step -1
If Cells(R, X).Value = "" Then
Else
Target.Value = Cells(R, X).Value & " " & Target.Value
Cells(R, X).Value = ""
Exit Sub
End If
Next
End Sub

I try to explain the routine also if my english is very poor.:-))
By your sample, text in column will arrange your data in the first 12
columns,
that is from column A to L.
Effect the doubleclic on the column N and that column will contain
the
number I supose to be the Zip Code. (Old zip code is blanked)
Doubleclic on column M = State (old state is blanked)
Doubleclic on column L = City (old city is blanked)
If the city is written as SANTA ANA the doubleclic on
the same column L, that now contain ANA = SANTA ANA
an so on,
Continue up to column B if necessary.

Regards
Eliano