Livin404
Well-known Member
- Joined
- Jan 7, 2019
- Messages
- 774
- Office Version
- 365
- 2019
- Platform
- Windows
I've been working on a macro for the last couple of hours and I'm only getting more frustrated. I am trying to get a code that will look for blank Rows where in Column C there is data but not data in Column R. The code I've used is: I think I only need it for one Column, so I made my range narrow. Unfortunately it extends well beyond what I need. Again it is for Column R and the blank cells will start no lower than R5. The height will always very.
VBA Code:
Sub Color_Blank_Cells()
Dim Count_row As Long
Dim Count_col As Long
Dim X As Range
Dim Y As Range
Sheets("Outbound").Activate
Count_row = WorksheetFunction.CountA(Range("C2", Range("R5").End(xlDown)))
Count_col = WorksheetFunction.CountA(Range("C5", Range("R5").End(xlToRight)))
Set X = Range(Cells(5, 18), Cells(Count_row, 18))
For Each Y In X.Cells
If Y = "" Then
Y.Interior.Color = RGB(255, 255, 0)
End If
Next Y
End Sub