+ Reply to Thread
Results 1 to 5 of 5

Find all cells with given text and how to do the opposite of Intersect

  1. #1
    Registered User
    Join Date
    02-23-2010
    Location
    Finland
    MS-Off Ver
    Excel 2003
    Posts
    3

    Find all cells with given text and how to do the opposite of Intersect

    Hi,

    Could you help me with these 3 issues I'm having pls?

    1) How do you find ALL cells with given text in one column?
    (result as Range, call it "types")

    2) How do you create a second range (call it "features"), which is based to the "types" range and which would contain the following cells: features(B1, C1, D1, B3, C3, D3, B4, C4, D4, B7, C7, D7) if the first range "types" would consist of all cells in A column with text "type1": types(A1, A3, A4, A7)

    r/c A B C D
    1 type1 1 a r
    2 type2 2 b s
    3 type1 3 c t
    4 type1 4 d u
    5 type2 5 e v
    6 type3 6 f w
    7 type1 7 g x
    8 type2 8 h y

    I would like to avoid looping all cells in a for loop because my data sets are thousands of rows long, tens of columns wide, and speed is a critical issue.

    3) I have also tried to find an opposite function to Intersect like "Exclude", which would take two ranges, and return a range, which consists of those cells which are only in either of the given ranges and not in both. Do you know if there's one?

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Find all cells with given text and how to do the opposite of Intersect

    1) Find method.
    2) No idea what that means.
    3) AFAIK there is no single method, but it could be worked around.

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Find all cells with given text and how to do the opposite of Intersect

    Could you not apply an Auto Filter?

    First range being column 1 visible cells
    Second range being columns 2:4 visible cells

    Given volume of data and fact that altering Row Visibility is Volatile action you should definitely toggle events etc....

    If you can you should consider sorting the data by Type first such that you have a contiguous range.

  4. #4
    Registered User
    Join Date
    02-23-2010
    Location
    Finland
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Find all cells with given text and how to do the opposite of Intersect

    Great thanks to both! Autofilters are superb! It took me a while to learn using autofilters and test with large data sets. Using them cut down processing time about 80-90% compared to For loops. Thanks guys for helping me out!

  5. #5
    Registered User
    Join Date
    02-23-2010
    Location
    Finland
    MS-Off Ver
    Excel 2003
    Posts
    3

    Lightbulb Re: Find all cells with given text and how to do the opposite of Intersect

    Here's what I did in case someone is interested of using autofilters in similar conditions. The attachment shows the test setup:

    Please Login or Register  to view this content.
    Attached Images Attached Images

+ 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