+ Reply to Thread
Results 1 to 12 of 12

Search for keywords and copy rows containing keywords to new sheet

Hybrid View

  1. #1
    Registered User
    Join Date
    10-18-2012
    Location
    toncul
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Search for keywords and copy rows containing keywords to new sheet

    thanks to you guys.

    AB33: your macro works very well with the example but it fails when I copy it to my real excel file with 3500 rows. The data actually starts from row 5 in my real excel sheet. The debug highligths the line If x(i,3) like ... and says x(i,3)=<subscript out of range>.
    If I change to i=5 instead of i=2 as the list starts from row 5 then I get another bug at the line .Range("A2").Resize(n, UBound(y,2))=y

    OllieB: In the example sheet I have 2 lines containing the word "Structural" but only one of them is copied.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Search for keywords and copy rows containing keywords to new sheet

    If you have gaps in your data, you can use this line, instead.

     With Worksheets("Sheet1")
        x = .Range("a5:c" & .Range("A" & .Rows.Count).End(xlUp).Row)
     End With

  3. #3
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Search for keywords and copy rows containing keywords to new sheet

    lenorsk,

    oops, you were right - there was a mistake. New/corrected version attached. Sorry
    Attached Files Attached Files
    If you like my contribution click the star icon!

+ 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. [SOLVED] HDI - Return multiple keywords in a text column based on a set of available keywords
    By zneiley in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-25-2013, 01:32 PM
  2. [SOLVED] How to search across 2 columns for keywords from a list and copy each row to a new sheet?
    By keithtran12 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 04-01-2013, 05:16 AM
  3. search multiple columns and count number of rows the keywords appear
    By vincegc8 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-22-2013, 02:01 PM
  4. Set of keywords to search and move whole rows to another tab
    By lxdeb in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-07-2012, 03:17 PM
  5. Macro to Search and Copy Multiple Keywords into Another Sheet
    By Bangarang in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 08-05-2010, 01:57 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