Line up records (sorting)

  • Thread starter Thread starter Brian Issa
  • Start date Start date
B

Brian Issa

I have 2 columns. Column A has values (numbers for the taxlots o
interest) that are not sorted in any order. Column B has the sam
values plus a bunch of extraneous values that do not appear in column
(numbers of other taxlots in the city). Columns C-G have values tha
correspond to the values in column B (Owner information for the taxlo
values in B)

What I need to have happen is either search column B for the values i
column A and delete all the extraneous records (columns B-G), or, alig
the values in column A so that they correspond to the locations of th
same values in column B.

Not sure if that's clear so here's a a simplified version

Column A Column B Coulmn C
D A A
A D D
T R R
T T

Need to line up values in A with there corresponding values in B (an
C), or sort through B(and C) and remove values not found in column A.

Any suggestions????

Thank
 
Brian
I'm not too sure of what you want but here is one shot at it. The
following macro loops through all the occupied cells in Column B and, for
each Column B entry that is not found in Column A, clears the contents of
Columns B:G. Make a copy of your file and try this out on the copy first.
Please post back if this is not clear or this is not what you want. HTH
Otto
Sub RemoveExtra()
Dim RngColA As Range
Dim RngColB As Range
Dim i As Range
Set RngColA = Range("A1", Range("A" & Rows.Count).End(xlUp))
Set RngColB = Range("B1", Range("B" & Rows.Count).End(xlUp))
For Each i In RngColB
If RngColA.Find(What:=i.Value, LookAt:=xlWhole) Is Nothing Then _
i.Resize(, 6).ClearContents
Next i
End Sub
 
Back
Top