+ Reply to Thread
Results 1 to 2 of 2

Conditional lookup

  1. #1
    Registered User
    Join Date
    07-24-2009
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2003
    Posts
    8

    Conditional lookup

    I need to lookup rows from sheet 1 to construct a list in sheet 2 but I only want data from rows that match a certain criteria, and I do not want any empty rows:

    Example: Criteria is "Type 3"

    Sheet1:

    A1 "CarA", B1 "Type 2"
    A2 "CarB" B2 "Type 3"
    A3 "LorryA" B3 "Type 3"

    I would like this to produce the following in sheet 2:

    A1 "CarB" B1 "Type 3"
    A2 "Lorry" B2 "Type 3"

    Anyone?

    Thanks

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Conditional lookup

    VBA isn't necessary, but it can surely be done that way.

    Manual (and quick) method:
    1) On sheet 1 click in the data and select DATA > FILTER > AUTOFILTER
    2) Filter by the Type column for "Type 3" and all other rows will be hidden.
    3) Copy all visible data enmasse to another sheet.


    VBA
    You could simply record yourself doing those steps above and have a workable macro, or at least the base code that's easy enough to tweak.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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