View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
JeffK JeffK is offline
external usenet poster
 
Posts: 53
Default Warning pop up window

Worked like a charm! Thanks Mike

"Mike H" wrote:

Hi,

Try this

Private Sub ClearPage_Click()
response = MsgBox("Are you sure you want to clear cells?", vbOKCancel)
If response < vbOK Then Exit Sub
Range("A4:B6").ClearContents
End Sub
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"JeffK" wrote:

I have programmed a "clear worksheet" button on my page and I'd like to have
a warning window pop up to warn if the user wants to do this.

Private Sub ClearPage_Click()
Range ("A4:B6").Select
Selection.ClearContents
End Sub

Thanks for your help