+ Reply to Thread
Results 1 to 8 of 8

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

  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-2

    I was just helped on a query in regards to returning values based on a specific string and I have another situation I am hoping to get help on...

    In the sample provided, I have data that will repeat a number of times. Anytime the string "<Event>Status Changed</Event>" occurs twice in a row, I need to return the, "<Entity RecordID="XXXXXXX">" that is located directly above them. I would like the results to replace the data if possible.

    So for the Sample data attached, the result would look like this:

    Starting in A1 on Sheet "Sample"
    <Entity RecordID="28469234">
    <Entity RecordID="28469348">
    <Entity RecordID="28469389">


    Thank you in advance!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

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

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

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

    Maybe:

    Please Login or Register  to view this content.
    Places results in Column K - can be modified if necessary.

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

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

    My mistake on my sample data...Sometimes there are situations when the string occurs 3, 4, 5 times as well and I only want it when it happens twice...See new attachment. Results should remain the same.
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

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

    Please Login or Register  to view this content.

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

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

    You guys are amazing!

  7. #7
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

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

    Glad to help. Please mark this thread as SOLVED.

    And I'm sure anyone that provided helpful answers would appreciate reputation (the * in the lower left of the posts).

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

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

    Thank you for the completion guidance...I added positive comments for all that assisted. Unfortunately I could not Add for you all multiple times for the help on my different issues.

    Thank you again for you quick responses!

+ 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
    By owensjb2 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-01-2015, 11:28 AM
  2. 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
  3. [SOLVED] Search for a text string and return given text string to adjacent cell
    By hecgroups in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-14-2015, 04:50 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