@nigel - no problem, and right-back-at-cha on previous postings you've shared.
@OP
Yeah, it wasn't terribly slow and may do the trick for you completely. I shy away from "just loop over every cell in the worksheet" methods as much as possible.
I occurred to me while I was typing that previous sentence - that you could just check the blank cells in the used range, which would be less iterations through the loop.
Adjusted code - just checks the blank cells in the usedRange to see if they are yellow:
I also added a 'cell.select' line to take the user to the required cells that caused the routine to exit in the first place.![]()
Option Explicit Sub test() Dim Cell As Range For Each Cell In Sheets("Sheet1").UsedRange.SpecialCells(xlCellTypeBlanks) If Cell.Interior.ColorIndex = 6 Then Cell.Select MsgBox "Please ensure that you have filled " & Chr(10) & "out all empty yellow fields'.", vbOKOnly + vbInformation, "Please fill empty fields" Exit Sub End If Next Cell End Sub
Bookmarks