ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,232
- Office Version
- 2007
- Platform
- Windows
Hi,
I have the code below in use
All works fine but if i run the code & there are no vales in the cells to be cleared i get a run time error 1004 NO CELLS FOUND
If i put On error resume next after the Private Sub part,
1, Will that stop the error message ?
2, Do i need to add anything else or is On error resume next enough ?
Thanks please advise.
I have the code below in use
All works fine but if i run the code & there are no vales in the cells to be cleared i get a run time error 1004 NO CELLS FOUND
Rich (BB code):
Private Sub ClearSheet_Click()
Dim answer As Integer
answer = MsgBox("IS IT OK TO DELETE SHEET FIGURES ? ", vbCritical + vbYesNo + vbDefaultButton2, "DLETE WORKSHEET FIGURES MESSAGE")
If answer = vbNo Then
Exit Sub
End If
Range("B1:D1").ClearContents
Range("A34").ClearContents
Sheet12.Range("A3:D29").SpecialCells(xlCellTypeConstants).ClearContents
Range("A3").Select
MsgBox "CELLS HAVE NOW BEEN CLEARED", vbInformation
End Sub
If i put On error resume next after the Private Sub part,
1, Will that stop the error message ?
2, Do i need to add anything else or is On error resume next enough ?
Thanks please advise.