+ Reply to Thread
Results 1 to 3 of 3

Script to Search for a specific String then return cell values above that String-3

  1. #1
    Registered User
    Join Date
    05-08-2010
    Location
    AZ
    MS-Off Ver
    Excel 2007
    Posts
    49

    Script to Search for a specific String then return cell values above that String-3

    OK, Last one for today...I think

    In the sample data you will see the string, "<Note>Record status set to 'Positive Match'</Note>" 3 times. For each of those three occurances I want to the "RecordID" above it to be shown. As you can see in the data, sometimes the string will be directly below the RecordID, sometimes 2 below and so on. I would like the result to replace the data starting in A1.

    So for the Sample data, the results would be (Starting in A1):


    <Entity RecordID="28579337">
    <Entity RecordID="28579338">
    <Entity RecordID="28582758">
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    11-12-2014
    Location
    Nottingham
    MS-Off Ver
    2013
    Posts
    383

    Re: Script to Search for a specific String then return cell values above that String-3

    Tried and tested code
    Please Login or Register  to view this content.
    Note: This currently copies all required into a sheet called "sheet2"

  3. #3
    Valued Forum Contributor Sean Thomas's Avatar
    Join Date
    03-25-2012
    Location
    HerneBay, Kent, UK
    MS-Off Ver
    Excel 2007,2016
    Posts
    971

    Re: Script to Search for a specific String then return cell values above that String-3

    Please Login or Register  to view this content.
    Regards
    Sean

    Please add to my reputation if you think i helped
    (click on the star below the post)
    Mark threads as "Solved" if you have your answer
    (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code:
    [code] Your code here [code]
    Please supply a workbook containing example Data:
    It makes its easier to answer your problem & saves time!

+ 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] Script to Search for a specific String then return cell values above that String-2
    By owensjb2 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-01-2015, 01:00 PM
  2. [SOLVED] Script to Search for a specific String then return cell values above that String
    By owensjb2 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-01-2015, 11:28 AM
  3. Macro Script to return a cell values realted to a string
    By owensjb2 in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 03-26-2015, 09:27 AM
  4. VBA to search files within a folder for a specific string and return file name
    By tjej6987 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-03-2014, 12:41 PM
  5. Replies: 3
    Last Post: 10-03-2012, 03:09 AM

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