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
1. Will you want to format the entire row across the whole sheet or just the table?how can i check a range of columns for a blank cell and then conditionally format the row to change color?
Excel Workbook | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
P | Q | R | S | T | U | V | W | X | |||
4 | |||||||||||
5 | |||||||||||
6 | asd | asd | asd | asd | asd | asd | asd | ||||
7 | asd | asd | asd | asd | asd | asd | |||||
8 | asd | asd | asd | asd | asd | asd | asd | ||||
9 | asd | asd | asd | asd | asd | asd | |||||
10 | asd | asd | asd | asd | asd | asd | asd | ||||
11 | asd | asd | asd | asd | asd | asd | asd | ||||
12 | asd | asd | asd | asd | asd | asd | asd | ||||
13 | asd | asd | asd | asd | asd | ||||||
14 | asd | asd | asd | asd | asd | asd | asd | ||||
15 | asd | asd | asd | asd | asd | asd | asd | ||||
16 | asd | asd | asd | asd | asd | asd | |||||
17 | |||||||||||
18 | asd | asd | asd | asd | asd | asd | asd | ||||
19 | asd | asd | asd | asd | asd | asd | asd | ||||
20 | |||||||||||
Sheet |
Cells with Conditional Formatting | ||||
---|---|---|---|---|
Cell | Condition | Cell Format | Stop If True | |
Q6 | 1. / Formula is =(COUNTBLANK($R6:$T6)+COUNTBLANK($W6))>0 | Abc |
What version of Excel are you using?how can i check a range of columns for a blank cell and then conditionally format the row to change color?
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?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.