+ Reply to Thread
Results 1 to 3 of 3

Line up records (sorting)

  1. #1
    Registered User
    Join Date
    09-12-2005
    Posts
    2

    Line up records (sorting)

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

    What I need to have happen is either search column B for the values in column A and delete all the extraneous records (columns B-G), or, align the values in column A so that they correspond to the locations of the 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 (ans C), or sort through B(and C) and remove values not found in column A.

    Any suggestions????

    Thanks

  2. #2
    Otto Moehrbach
    Guest

    Re: Line up records (sorting)

    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
    "Brian Issa" <[email protected]> wrote
    in message news:[email protected]...
    >
    > I have 2 columns. Column A has values (numbers for the taxlots of
    > interest) that are not sorted in any order. Column B has the same
    > values plus a bunch of extraneous values that do not appear in column A
    > (numbers of other taxlots in the city). Columns C-G have values that
    > correspond to the values in column B (Owner information for the taxlot
    > values in B)
    >
    > What I need to have happen is either search column B for the values in
    > column A and delete all the extraneous records (columns B-G), or, align
    > the values in column A so that they correspond to the locations of the
    > 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 (ans
    > C), or sort through B(and C) and remove values not found in column A.
    >
    > Any suggestions????
    >
    > Thanks
    >
    >
    > --
    > Brian Issa
    > ------------------------------------------------------------------------
    > Brian Issa's Profile:
    > http://www.excelforum.com/member.php...o&userid=27182
    > View this thread: http://www.excelforum.com/showthread...hreadid=466841
    >




  3. #3
    Registered User
    Join Date
    09-12-2005
    Posts
    2

    Thanks

    That was exactly what I was looking for!
    Much appreciated.
    Brian

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1