Highlighting null-valued cells

  • I am trying to run a macro that would go through my data and change the background color of a cell that has no value in it. Here is kinda what I am trying to do:

    If cell C2 = "yes" and E2= null, then set cell color to RGB (0,255,0)

    The macro should run down each column of data, going up to 20 columns. I don't have a defined range because my data sets vary in length. My experience with VB is very limited. Any help with the code is appreciated.


  • Thank you for the tip, but what I am trying to do is construct a macro that would go through a lot of data and automatically select a null valued cell and change the cell color so that it can be easily identified. Manual selection of the cells would be very time consuming. Some null valued cells can be left alone if related data in the respective row is found to be false.


  • Hi,

    here's to test
    assuming cell A1 is included in the table area, if not, change "a1" to any cell name within the table area.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!