sassy
New Member
- Joined
- Feb 23, 2009
- Messages
- 38
Hi, I need a little help from the experts!!! I have the following code and the cancel button is not working. It still runs the rest of the SUB. Is there a way, without using an IF statement to make the Cancel button on the message box work? Also, if i have to use an IF statement, do I have to change the DIM statement?
thanks!!!
Sub Clear_Sheet()
'This will clear the data entry sheet only. only has cell that are completed as of 1/17/2011
Dim Response As VbMsgBoxResult
'
Response = MsgBox("Are you sure you want to clear the sheet?", vbOKCancel, "Clear Sheet?")
Worksheets("Data Entry").Select
ActiveSheet.Unprotect
'
Range("I92,D2:E2,D4:E4,D6:E6,D8:E8,D10:E10,H18,B20:H20,H24,B26:H26").Select
Range("B26").Activate
Selection.ClearContents
thanks!!!
Sub Clear_Sheet()
'This will clear the data entry sheet only. only has cell that are completed as of 1/17/2011
Dim Response As VbMsgBoxResult
'
Response = MsgBox("Are you sure you want to clear the sheet?", vbOKCancel, "Clear Sheet?")
Worksheets("Data Entry").Select
ActiveSheet.Unprotect
'
Range("I92,D2:E2,D4:E4,D6:E6,D8:E8,D10:E10,H18,B20:H20,H24,B26:H26").Select
Range("B26").Activate
Selection.ClearContents