+ Reply to Thread
Results 1 to 6 of 6

if text not in cell then delete adjacent cell and loop until last cell with value

  1. #1
    Registered User
    Join Date
    10-29-2017
    Location
    Miami, FL
    MS-Off Ver
    2010
    Posts
    76

    if text not in cell then delete adjacent cell and loop until last cell with value

    hi! please help, i cant figure out how to write this macro. i have attached a sample file for reference.

    i want to make a macro such that
    if the word "coupon" is NOT in the first cell with text starting in A2 THEN delete the text in the adjacent cell in coloumn C... so since A4 doesnt say coupon, the cell C4 should be blank
    then i would like this to loop until the last cell with text in colomn A

    also, i want to create the same macro but for the word "blu". IF a cell in colomn A, starting with A2, does NOT have the word "blu" THEN the adjacent cell in column d should be blank. i.e. a3 doesnt have blue, thus d3 should be blank

    the sheet titled "origiinal" is that data and the sheet titled "final" is the result the macro should produce. please help any way possible!!!!! thank you in advance!!!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,692

    Re: if text not in cell then delete adjacent cell and loop until last cell with value

    How big is your original file?
    This would be a nice and slow way of getting results.

    Please Login or Register  to view this content.

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: if text not in cell then delete adjacent cell and loop until last cell with value

    AutoFilter...
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    10-29-2017
    Location
    Miami, FL
    MS-Off Ver
    2010
    Posts
    76
    This works for the file attached, but it unfortunately doesn’t work with the original file... which I can upload. It deleted the entire Colombo in the original file instead of just the cell. Do you know how to fix this? Please and thank you!!

    Quote Originally Posted by jolivanes View Post
    How big is your original file?
    This would be a nice and slow way of getting results.

    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,692

    Re: if text not in cell then delete adjacent cell and loop until last cell with value

    Where did you get "Colombo" from.
    It's no use attaching a non representative file.

  6. #6
    Registered User
    Join Date
    10-29-2017
    Location
    Miami, FL
    MS-Off Ver
    2010
    Posts
    76
    Haha sorry... I meant column. Do you know why this would be happening?

    UPDATE: this worked!!! It was just caps sensitive. Thank you!!!!


    Quote Originally Posted by jolivanes View Post
    Where did you get "Colombo" from.
    It's no use attaching a non representative file.
    Last edited by fruitloop44; 12-19-2017 at 03:39 PM.

+ 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. Loop: IF cell is not blank then output adjacent cell
    By dchubbock in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-20-2016, 12:58 PM
  2. Delete cell and adjacent cells if cell contains specific word
    By BPSJACK in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-14-2015, 05:19 PM
  3. Replies: 15
    Last Post: 12-05-2014, 01:14 AM
  4. [SOLVED] Macro to delete cell and its adjacent cell
    By tghiotto in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-08-2014, 12:59 PM
  5. Formula to identify part of a text in cell from range of cells & insert adjacent cell text
    By Novicebutnotforlong in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 11-19-2013, 02:11 AM
  6. [SOLVED] Identify Cells with value of 0 and delete 0 cell and adjacent cell
    By brgr4u in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-16-2013, 09:04 AM
  7. Delete cell contents with input to adjacent cell
    By Ashley Frank in forum Excel General
    Replies: 1
    Last Post: 10-05-2005, 12: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