Conditional Formatting w/blank CELL

MR3

Board Regular
Joined
Jun 10, 2008
Messages
175
how can i check a range of columns for a blank cell and then conditionally format the row to change color?
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Run this: Where in this example the Range is Cells A1:A10

Code:
Option Explicit
Sub HighlightBlanks()
Dim myRange As Range:   Set myRange = Range("A1:A10")
Dim icell As Range
 
For Each icell In myRange
    If IsEmpty(icell) Then
        icell.EntireRow.Interior.ColorIndex = 3
    End If
Next icell
 
End Sub
 
Upvote 0
how can i check a range of columns for a blank cell and then conditionally format the row to change color?
1. Will you want to format the entire row across the whole sheet or just the table?
2.Do you want to check ALL columns in a table or just some of them?

Below, the conditional format was applied to all the cells (green and orange) at once by selecting the range tpo left to bottom right so hat a cell on the top row is the active cell, then placed the formula into conditional formatting.
The formatting only checks for blanks in columns R,S,T AND W, but highlights the whole row in the table.
Excel Workbook
PQRSTUVWX
4
5
6asdasdasdasdasdasdasd
7asdasdasdasdasdasd
8asdasdasdasdasdasdasd
9asdasdasdasdasdasd
10asdasdasdasdasdasdasd
11asdasdasdasdasdasdasd
12asdasdasdasdasdasdasd
13asdasdasdasdasd
14asdasdasdasdasdasdasd
15asdasdasdasdasdasdasd
16asdasdasdasdasdasd
17
18asdasdasdasdasdasdasd
19asdasdasdasdasdasdasd
20
Sheet
Cells with Conditional Formatting
CellConditionCell FormatStop If True
Q61. / Formula is =(COUNTBLANK($R6:$T6)+COUNTBLANK($W6))>0Abc
 
Last edited:
Upvote 0
how can i check a range of columns for a blank cell and then conditionally format the row to change color?
What version of Excel are you using?

Use the "formula option" in conditional formatting and use a formula something like this:

=COUNTBLANK($A1:$C1)
 
Upvote 0
I am using 2007. And I only want to check columns D to Z but down to rows occupied with actual data. column A will define what actual length of the data will be max. when Column A is blank there will be no more data below that therefore I dont want to highlight rows below that.

Another solution could be just to highlight blank cells in a given column range.
 
Upvote 0
I am using 2007. And I only want to check columns D to Z but down to rows occupied with actual data. column A will define what actual length of the data will be max. when Column A is blank there will be no more data below that therefore I dont want to highlight rows below that.

Another solution could be just to highlight blank cells in a given column range.
So, you want to highlight the rows between columns D:Z if there are any empty cells on a row but only for those rows where the corresponding cell in column A has some entry?
 
Upvote 0


When i do SHIFT+CTRL+DOWN ARROW, it doesnt select all the cells that i want.
How can i automate the script so it will select all cells with values?
 
Upvote 0
SHIFT+CTRL+DOWN ARROW select the Current Region, which is the Contiguous range that your cursor is in. This mean it will select all cells around that cell until it finds the first completely blank row and column. Since there are no entries in row 7, that is where it is stopping.

So you would need to go about it a bit differently if you have "breaks" in your data like that. Is there are column that will always have data in it, if there is data in that particular row? Putting it another way, for every row that has data in it, are there any columns that are guaranteed to have data in that instance?
 
Upvote 0

Forum statistics

Threads
1,224,602
Messages
6,179,843
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top