jonathann3891
Board Regular
- Joined
- Apr 27, 2015
- Messages
- 109
Is it possible to add an IF statement to this code?
It works perfect, but if the cells are blank it give me the following error:
Run-time error '1004':
No cells were found
I dont want it go give an error if the cell is blank!
Thanks
Code:
Private Sub CommandButton2_Click()
Dim LR As Long
LR = Range("C" & Rows.Count).End(xlUp).Row
Range("C10:C" & LR).SpecialCells(xlCellTypeConstants, 23).Clear
End Sub
It works perfect, but if the cells are blank it give me the following error:
Run-time error '1004':
No cells were found
I dont want it go give an error if the cell is blank!
Thanks