Highlight blank blank cells in a specific column.

Livin404

Well-known Member
Joined
Jan 7, 2019
Messages
774
Office Version
  1. 365
  2. 2019
Platform
  1. 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


Fill blank.JPG
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Hi,

From your picture, would suggest to test
VBA Code:
Count_row = Application.Match("TOTAL", Range("R:R"), 0)
 
Upvote 1
Solution

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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