+ Reply to Thread
Results 1 to 5 of 5

Excel macro to insert row text in above cell if searched key found in below cells

  1. #1
    Registered User
    Join Date
    08-29-2022
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    18

    Excel macro to insert row text in above cell if searched key found in below cells

    I am searching for a flexible VBA code that will do the following:
    If the given keyword "*XC%.^&*-_1234_ABD*" is found in any below rows then
    insert a new row above it and add the text "Found_12234/#" in the above row.
    I have searched but could not find anything suitable.

  2. #2
    Valued Forum Contributor
    Join Date
    12-01-2011
    Location
    Philippines
    MS-Off Ver
    Excel 2016
    Posts
    949

    Re: Excel macro to insert row text in above cell if searched key found in below cells

    try

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    08-29-2022
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    18

    Re: Excel macro to insert row text in above cell if searched key found in below cells

    Nope, not working. If the first row (A1) has data then it can not create a new row above it with the text. Also, the runs are only for the first line.
    So, no new row is created with the key in it.
    Last edited by AliGW; 09-12-2022 at 07:56 AM. Reason: Please DON'T quote unnecessarily!

  4. #4
    Valued Forum Contributor
    Join Date
    12-01-2011
    Location
    Philippines
    MS-Off Ver
    Excel 2016
    Posts
    949

    Re: Excel macro to insert row text in above cell if searched key found in below cells

    try

    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,369

    Re: Excel macro to insert row text in above cell if searched key found in below cells

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not told us about this. You are required to do so.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. As yu are new here, I shall do it for you this time: https://www.mrexcel.com/board/thread...hrase.1216112/)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ 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] Need macro to insert modified cell text between other cells
    By NerdyMcNerdface in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-05-2019, 10:34 PM
  2. Replies: 5
    Last Post: 04-06-2019, 02:18 AM
  3. [SOLVED] Search for multiple words in row and return searched value if found in first cell
    By whomewhy in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 08-02-2018, 05:21 PM
  4. [SOLVED] Any Faster Way to Copy/Paste this range? (I have searched and searched and searched)
    By liquidmettle in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 12-12-2015, 02:33 PM
  5. Insert Text in a table cell in MS word from excel macro
    By jrp_167 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-29-2011, 01:02 PM
  6. [SOLVED] Need a macro to insert text in a cell that already has text.Excel
    By go1angel in forum Excel General
    Replies: 2
    Last Post: 10-05-2005, 06:05 PM
  7. Need a macro to insert text in a cell that already has text.Excel
    By go1angel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-04-2005, 02:05 PM

Tags for this Thread

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