+ Reply to Thread
Results 1 to 2 of 2

VBA code to search / select - how to exclude inactive items?

  1. #1
    Registered User
    Join Date
    03-04-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    48

    VBA code to search / select - how to exclude inactive items?

    Good day all;

    I have a file I've been using for a bit now, trying to isolate and not show the inactive items in these two searches:

    In this first example, the macro will copy and paste relevant information into a phone list for easy printing - I'd like to have it search Sheet2 range H:H for "a" to indicate the individual is active and thus should be on the list, and to exclude those that are not;

    Please Login or Register  to view this content.
    This second example is the command for a "search" key that returns the results based on the name entered into the search box, and displays those names in a list box for the user to select the one they are looking for - again I'd like to be able to exclude those that are not "active" - by excluding anyone that does not have an "a" in the sheet2 range H:H

    Please Login or Register  to view this content.
    Appreciate your time and wisdom!

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: VBA code to search / select - how to exclude inactive items?

    Depending on how many rows we are talking about, maybe you could filter the data first, filter for the textbox in column C then filter for "a" in column H, then you can loop through the filtered column and add your items.

    Here is a basic example, you will have to change it to suite your requirements.

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 5
    Last Post: 12-08-2016, 11:54 PM
  2. Multiple items Search, select, copy and past in new sheet!
    By nitozinho in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-17-2015, 05:33 AM
  3. Code to search for items, copy to different sheet and delete them
    By pemb3545 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-30-2014, 10:45 AM
  4. VBA code to select multiple items
    By garywinder in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-02-2012, 12:25 PM
  5. Simple code to select the inactive workbook
    By TyeReece in forum Excel General
    Replies: 2
    Last Post: 10-11-2011, 11:50 AM
  6. Multiselect ListBox - Active/Inactive Items
    By LCK in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-02-2005, 08:45 PM
  7. [SOLVED] Multiselect ListBox - Active/Inactive Items
    By LCK in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-02-2005, 06:17 PM

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