View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Warning pop up window

Try

Sub ClearPage_Click()
If MsgBox("Are You Sure?",vbYesNo) = vbNo Then
Exit Sub
End If
' code to clear the sheet
End Sub

Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]


On Mon, 15 Feb 2010 10:31:02 -0800, 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