All, below is the code that I use to delete contents of the open sheet. How
do I make it ask or show a message box with 'Yes' or 'No' asking to delet or
not? Thanks in advance.
Cells.Select
Selection.Delete Shift:=xlUp
End Sub
Dave Peterson - 12 Apr 2008 17:36 GMT
Dim resp as long
resp = msgbox(Prompt:="Are you sure", buttons:=vbyesno)
if resp = vbno then
'do nothing
else
activesheet.rows.delete
end if
> All, below is the code that I use to delete contents of the open sheet. How
> do I make it ask or show a message box with 'Yes' or 'No' asking to delet or
[quoted text clipped - 4 lines]
>
> End Sub

Signature
Dave Peterson
alish - 12 Apr 2008 18:36 GMT
Thanks, Dave, it worked!
> Dim resp as long
> resp = msgbox(Prompt:="Are you sure", buttons:=vbyesno)
[quoted text clipped - 12 lines]
> >
> > End Sub
Shane Devenshire - 12 Apr 2008 20:24 GMT
Hi,
Note also that you can simplify the code to
Cells.Clear
Cheers,
Shane Devenshire
Microsoft Excel MVP
You are automatically prompted
> All, below is the code that I use to delete contents of the open sheet.
> How
[quoted text clipped - 6 lines]
>
> End Sub