LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help with creating CLEAR button


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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Clear button vdmbqb Excel Discussion (Misc queries) 5 April 6th 08 04:21 PM
clear button vdmbqb Excel Discussion (Misc queries) 1 November 24th 07 04:52 PM
Clear Button JudyP Excel Discussion (Misc queries) 2 August 5th 06 08:01 PM
create a clear button jbf frylock Excel Discussion (Misc queries) 9 January 6th 06 11:00 PM
Button to clear all entries? Randy Excel Worksheet Functions 2 March 26th 05 05:00 PM


All times are GMT +1. The time now is 05:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"