+ Reply to Thread
Results 1 to 10 of 10

Make conditional format ignore blank cells.

  1. #1
    Registered User
    Join Date
    11-15-2013
    Location
    Newquay, Cornwall
    MS-Off Ver
    Excel 2010
    Posts
    67

    Make conditional format ignore blank cells.

    I am trying to apply conditional formatting to a sheet, but the formatting is taking the inserted blank (but coloured) lines value as 0 and changing the colour of the particular cell on the inserted lines.

    Does anyone know how to change a conditional format statement to ignore cells with no value in them?

    Currently code :

    Please Login or Register  to view this content.
    How can I modify this to ignore the blank inserted lines/cells?
    Still learning... one day I will be able to help!

  2. #2
    Valued Forum Contributor
    Join Date
    05-20-2013
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2013
    Posts
    941

    Re: Make conditional format ignore blank cells.

    It appears your conditional formula is =V2<=Y2. Change it to (perhaps) =AND(V2<=Y2,?<>""), replacing the "?" with the blank cell reference (B2 perhaps).
    Last edited by jhren; 07-22-2015 at 07:55 AM.

  3. #3
    Registered User
    Join Date
    11-15-2013
    Location
    Newquay, Cornwall
    MS-Off Ver
    Excel 2010
    Posts
    67

    Re: Make conditional format ignore blank cells.

    Thanks for the quick reply.

    Just tried it and getting 'Run time error '5''
    Invalid procedure call or argument.

    Is there a comma/bracket or speech mark missing somewhere? I have tried with the blank cell reference as B2 and A2, but both return the same error. It can test any cell in a row for a blank reference.
    Last edited by Graham Pall; 07-22-2015 at 08:03 AM.

  4. #4
    Valued Forum Contributor
    Join Date
    05-20-2013
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2013
    Posts
    941

    Re: Make conditional format ignore blank cells.

    Ahhh... scripting not my forte... IIRC, your have to concatenate the formula using ..."&CHAR(34)&CHAR(34)&"... inplace of the quotes in the formula. e.g.:
    ="=AND(V2<=Y2,B2<>"&CHAR(34)&CHAR(34)&")"

  5. #5
    Registered User
    Join Date
    07-22-2015
    Location
    London
    MS-Off Ver
    Mac OS
    Posts
    7

    Re: Make conditional format ignore blank cells.

    Thanks for help

  6. #6
    Registered User
    Join Date
    11-15-2013
    Location
    Newquay, Cornwall
    MS-Off Ver
    Excel 2010
    Posts
    67

    Re: Make conditional format ignore blank cells.

    Quote Originally Posted by jhren View Post
    Ahhh... scripting not my forte... IIRC, your have to concatenate the formula using ..."&CHAR(34)&CHAR(34)&"... inplace of the quotes in the formula. e.g.:
    ="=AND(V2<=Y2,B2<>"&CHAR(34)&CHAR(34)&")"
    Yes, sorry, should have specified this was being carried out in a macro.

    I tried your variation above and now VBA Editor is showing:

    Compile Error
    Sub or Function not defined

    And it's highlighting the first instance of 'CHAR'.

    I suspect we are very close.......

  7. #7
    Valued Forum Contributor
    Join Date
    05-20-2013
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2013
    Posts
    941

    Re: Make conditional format ignore blank cells.

    Perhaps it's CHR(34)?

    Or try it like this...
    ="=AND(V2<=Y2,B2<>"""")"

    If these don't work, I guess I am out of my elements.
    Last edited by jhren; 07-22-2015 at 08:44 AM.

  8. #8
    Registered User
    Join Date
    11-15-2013
    Location
    Newquay, Cornwall
    MS-Off Ver
    Excel 2010
    Posts
    67

    Re: Make conditional format ignore blank cells.

    Quote Originally Posted by jhren View Post
    Perhaps it's CHR(34)?
    That's the puppy! Thanks very much jhren. You have been my source of learning something new today .

  9. #9
    Valued Forum Contributor
    Join Date
    05-20-2013
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2013
    Posts
    941

    Re: Make conditional format ignore blank cells.

    Your welcome, and thank you... I don't do scripting often enough to remember all the peculiarities, so I consider this a refresher with purpose... and I also learned myself that the ..."&CHR(34)&CHR(34)"... can be replaced with ...""""...

  10. #10
    Registered User
    Join Date
    11-15-2013
    Location
    Newquay, Cornwall
    MS-Off Ver
    Excel 2010
    Posts
    67

    Re: Make conditional format ignore blank cells.

    I am at the moment learning MS Access too. One of my friends who is a VERY experienced DBA is teaching me, and he is quite enjoying it as a refresher to more beginner stuff he might have forgotten. Usually both sides benefit somewhere in the teaching! That's what I love about this forum.

+ 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. Conditional Formatting - ignore Blank Cells
    By therealtfloss in forum Excel General
    Replies: 1
    Last Post: 02-09-2015, 11:38 AM
  2. Ignore blank cells in conditional format
    By hbiglay in forum Excel General
    Replies: 18
    Last Post: 05-20-2014, 12:39 PM
  3. How can I make a macro ignore blank cells? - Blank Cells have formulas
    By mz1161 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-30-2013, 08:54 AM
  4. [SOLVED] How to get Conditional Formatting to ignore blank cells?
    By AndyHawke in forum Excel General
    Replies: 3
    Last Post: 08-22-2012, 08:25 AM
  5. How to ignore blank cells in conditional formatting?
    By Gooford in forum Excel General
    Replies: 5
    Last Post: 08-22-2012, 08:06 AM
  6. Replies: 2
    Last Post: 12-16-2011, 10:35 AM
  7. how to make a formula ignore blank cells
    By Snap in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-07-2006, 08:00 PM

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