+ Reply to Thread
Results 1 to 8 of 8

Search for Substring within a String using loop

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

    Search for Substring within a String using loop

    I have a very long spread sheet with tons of data. What I need to do is to search the spreadsheet using a loop func (or other better ideas) of Column1 until it finds a substring called STARTDATA1, and ends the loop until it finds a substring called ENDDATA1. And all the values inbetween the rows of STARTDATA1 and ENDDATA1, I need to parse values of column 3,5,7 onto another template. How should I write the code?

    Hallet

  2. #2
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Search for Substring within a String using loop

    please upload an example workbook
    Remember, saying thanks only takes a second or two. Click the star icon(*) below the post you liked, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.

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

    Re: Search for Substring within a String using loop

    Workbook 1.xlsx
    So heres part of the worksheet,
    I need to collect the values from "0/ BEGINDATA1" which should be row 1398, uptill "0/ ENDDATA1", which should be row 1547, So I need a loop that can detect the substrings,when it detects 0/ BEGINDATA1, it starts to take in the values of column 3,5,7 until the loop detects 0/ ENDDATA1, and parse all the data into another template

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

    Re: Search for Substring within a String using loop

    bump...
    Anyone has any idea?

  5. #5
    Valued Forum Contributor StevenM's Avatar
    Join Date
    03-23-2008
    Location
    New Lenox, IL USA
    MS-Off Ver
    2007
    Posts
    910

    Re: Search for Substring within a String using loop

    Copies Data from Active Sheet to Sheet 2
    Column G was Blank in the example you uploaded.

    Please Login or Register  to view this content.

  6. #6
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Search for Substring within a String using loop

    Yes...many, but what do you want to parse to? are you looking to just paste? not sure what "take in the values" mean.

    Finding those tags ("0 / BEGINDATA1" and "0 / ENDDATA1") is very easy (so is designing a loop to look at the data between).
    Example:

    Please Login or Register  to view this content.

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

    Re: Search for Substring within a String using loop

    yes, paste the values under column x,y,z of sheet2

  8. #8
    Registered User
    Join Date
    05-09-2012
    Location
    Des Moines, IA
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Search for Substring within a String using loop

    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