+ Reply to Thread
Results 1 to 4 of 4

Search for SubString

  1. #1
    Registered User
    Join Date
    05-09-2012
    Location
    Calgary,Canada
    MS-Off Ver
    Excel 2010
    Posts
    50

    Search for SubString

    Hi everyone,

    I need to search for a a substring under column x, and search for another substring under column y, then I need to paste the data that is inbetween the rows of these 2 substrings, taking only column 2 and 8, and paste them onto another file onto cell(1,2) and cell(1,3)

    How should I write the loop for this procedure?

    And if I didn't want to hard-code the data onto specific cells, how I make it so it takes the first empty cell after cell(1,1) in row 1?
    For ex: If I were to take column 3,5,7,9...how to I paste them onto column (1,2) (1,3) (1,4) (1,5)... without hard-coding them?

    If it doesn't make sense to you, I can provide a workbook.

    Thanks

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Search for SubString

    Suggest supplying a workbook.
    Martin

  3. #3
    Registered User
    Join Date
    05-09-2012
    Location
    Calgary,Canada
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: Search for SubString

    workBook1.xlsx
    So in this example, I need to search column 2 for "stardata1", then it starts to record the data for column 2 and column 8 under Q2 and Q8 starting at the row right below the detected string,(Q2, Q8 are desired subjects) up until it detects the string "enddata1" in column 1, then the loop is terminated.
    And then paste the 2 columns of datas (Q2, Q8) onto new file workBook2.xlsx

  4. #4
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Search for SubString

    Try this

    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)

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