lezawang
Well-known Member
- Joined
- Mar 27, 2016
- Messages
- 1,805
- Office Version
- 2016
- Platform
- Windows
Hi the code below (not mine thanks for your help) is to highlight blank cells (no cells has spacebar). It works perfectly but is the Selection has no empty cells or cells with spacebar then i get run-time "no cells we found" and the program terminate. Can that code modified so if the Selection has no empty cells then a message display (msgbox no empty cells found).
Thank you so much
Sub blank()
Dim x As Range
Set x = Selection
x.SpecialCells(xlCellTypeBlanks).Interior.Color = vbRed
End Sub
Thank you so much
Sub blank()
Dim x As Range
Set x = Selection
x.SpecialCells(xlCellTypeBlanks).Interior.Color = vbRed
End Sub