Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
msg box to clear a sheet
I need a msg box that has a yes and no button that ask if you want to clear
the sheet. If yes then continue to run the macro and if no then to stop at that point. any help is appreciated. thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
msg box to clear a sheet
change the range to suit your needs
Sub Clear_Sheet() Select Case MsgBox("Are you sure you want to clear all data?", _ vbYesNo Or vbQuestion Or vbDefaultButton1, Application.Name) Case vbYes ActiveSheet.Range("B3:O65,Q3:Q65").ClearContents Case vbNo End Select End Sub -- Gary "Curt D." wrote in message ... I need a msg box that has a yes and no button that ask if you want to clear the sheet. If yes then continue to run the macro and if no then to stop at that point. any help is appreciated. thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
msg box to clear a sheet
Thanks that did it.
"Gary Keramidas" wrote: change the range to suit your needs Sub Clear_Sheet() Select Case MsgBox("Are you sure you want to clear all data?", _ vbYesNo Or vbQuestion Or vbDefaultButton1, Application.Name) Case vbYes ActiveSheet.Range("B3:O65,Q3:Q65").ClearContents Case vbNo End Select End Sub -- Gary "Curt D." wrote in message ... I need a msg box that has a yes and no button that ask if you want to clear the sheet. If yes then continue to run the macro and if no then to stop at that point. any help is appreciated. thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy Sheet to new Sheet and clear cells on original sheets | Excel Discussion (Misc queries) | |||
Sheet Checkboxes clear | Excel Programming | |||
How to Clear all Data on sheet after a given row | Excel Programming | |||
Clear all cell in a sheet | Excel Programming | |||
Code to clear sheet | Excel Programming |