+ Reply to Thread
Results 1 to 3 of 3

Leave a cell blank if found "Cancelled" in adjacent column

  1. #1
    Forum Contributor
    Join Date
    10-05-2017
    Location
    Altamonte Springs, FL
    MS-Off Ver
    Office 365
    Posts
    146

    Leave a cell blank if found "Cancelled" in adjacent column

    Please help.

    I'm trying to leave a cell blank if the word "cancelled" shows up in the column to the right, but using a portion of the text in that adjacent column if the "Cancelled" does NOT show up.

    I have a feeling that my quotes may be the problem, but I have little experience with VBA, so I don't know for sure.

    Do you see why I keep getting syntax and/or object/application-defined errors?

    Range("AE2").Select
    ActiveCell.FormulaR1C1 = "=IFERROR(if(isnumber(search(""cancelled"",rc[1])),"" "",(LEFT(RC[1],SEARCH("" "",RC[1],1))),"" "")"


    Thank you!
    Last edited by jmklei0; 12-13-2017 at 05:22 PM. Reason: incorrect syntax

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,944

    Re: Leave a cell blank if found "Cancelled" in adjacent column

    Try this:

    Please Login or Register  to view this content.
    The best way to work with formulas in VBA is to get your formula to work in a cell, then start recording a macro, select the cell, press F2 to get into Edit mode, then press Enter and stop recording the macro. You will get the correct syntax for the code based on that recorded code.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Forum Contributor
    Join Date
    10-05-2017
    Location
    Altamonte Springs, FL
    MS-Off Ver
    Office 365
    Posts
    146

    Re: Leave a cell blank if found "Cancelled" in adjacent column

    Excellent work, Sir! Thank you very much. It looks like the parentheses before "Left" was the issue. I was trying to copy a portion of a formula from earlier and didn't get the cut-off right.

    Thanks!

+ 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. Any alternative to "" to leave a cell blank ?
    By KomicJ in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-12-2015, 07:04 PM
  2. Replies: 6
    Last Post: 09-25-2013, 01:51 PM
  3. Replies: 8
    Last Post: 12-31-2012, 05:19 PM
  4. [SOLVED] Delete row if cell in Column N equal "Different" or Column P equals "Blank"
    By Cyberpawz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-17-2012, 08:25 AM
  5. Leave cell blank if SUM = "0"
    By tomvh444 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-28-2011, 02:47 PM
  6. Replies: 3
    Last Post: 12-14-2006, 01:36 PM
  7. Replies: 6
    Last Post: 10-27-2005, 11:05 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