Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Another option you can try Sub clear() Dim Msg, Style, Title, Response, MyString, varfilestring Msg = "Continuing will Delete all Data (i.e. Start New Week)" & Chr(13 _ & "Default values will replace" ' Define message. Style = vbYesNo + vbDefaultButton2 ' Define buttons. Title = "Erase Form Data" ' Define title. Response = MsgBox(Msg, Style, Title, Help, Ctxt) If Response = vbYes Then ' User chose Yes. MyString = "Yes" ' Perform some action. Range("B7:G57").Select Selection.ClearContents Range("I7:N57").Select Selection.ClearContents Range("P7:U57").Select Selection.ClearContents DONE Else ' User chose No. MyString = "No" ' Perform some action. DONE End If varfilestring = "Blank_Manning_v3" & ".xls" ActiveWorkbook.SaveAs varfilestring, FileFormat:=xlNormal password:="", WriteResPassword:="", ReadOnlyRecommended:=False CreateBackup:=True End Sub Will need modification for what you actually want. This way you a least get the chance not to run the macro should you trigger i accidental ----------------------------------------------- ~~ Message posted from http://www.ExcelTip.com ~~View and post usenet messages directly from http://www.ExcelForum.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Clear button | Excel Discussion (Misc queries) | |||
clear button | Excel Discussion (Misc queries) | |||
Clear Button | Excel Discussion (Misc queries) | |||
create a clear button | Excel Discussion (Misc queries) | |||
Button to clear all entries? | Excel Worksheet Functions |