lezawang
Well-known Member
- Joined
- Mar 27, 2016
- Messages
- 1,805
- Office Version
- 2016
- Platform
- Windows
Hi
The code below will highlight empty cells in a Selection. but if I do not have an empty cell then it would give me an error message. Could you please tell me how you would handle that error message? Thank you very much.
The code below will highlight empty cells in a Selection. but if I do not have an empty cell then it would give me an error message. Could you please tell me how you would handle that error message? Thank you very much.
Code:
Sub highlight_empty_cells()
Selection.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
End Sub