+ Reply to Thread
Results 1 to 5 of 5

Search for string across header row, then search for another string down found column

  1. #1
    Registered User
    Join Date
    11-17-2011
    Location
    Tucson, Arizona
    MS-Off Ver
    Excel 2007
    Posts
    9

    Search for string across header row, then search for another string down found column

    Hi forum gurus,

    I have a worksheet that needs to have its data re-orderd. This seems pretty straight forward, but I'm stumpped on how to use a found cell as the upper limit for another search range.

    Basically, I want to find the word "Comment" within (:=xlPart) the text string of header-row cells. When the string "Comment" is found, then I want to look down that column to see if any actual comments are present (four or more letters-- What:="????*").
    - If not, then continue to the next column where "Comment" is found in the header.
    - If so, then cut the entire column and insert it (sequentially for multiple finds) after column ("H"); then continue to the next column where "Comment" is found in the header and repeat.

    I get to the point of selecting the column range I want to search for actual comments, but then my search for comments looks across that row, instead of looking down the column. Here is my annotated vba code:

    Please Login or Register  to view this content.
    Thanks very much in advance....

    TucsonJack

  2. #2
    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 string across header row, then search for another string down found column

    Could you attach a worksheet (or a mockup of a worksheet)?

  3. #3
    Registered User
    Join Date
    11-17-2011
    Location
    Tucson, Arizona
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Search for string across header row, then search for another string down found column

    Here is a sample worksheet.

    Thanks much
    Attached Files Attached Files

  4. #4
    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 string across header row, then search for another string down found column

    I think I got this to work.
    Backup your data.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-17-2011
    Location
    Tucson, Arizona
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Search for string across header row, then search for another string down found column

    StevenM,

    Thank you so much. Your most elegant (compared to the clunky way I was approaching the problem) solution worked like a charm. I will study how you did this. I have much to learn.

    I haven't discovered how to assign credit to your contribution. I hope the "solved" marker does so. Again... amazingly fine work.. Thank you.

    TucsonJack

+ 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