Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / April 2008

Tip: Looking for answers? Try searching our database.

push button question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Finance Guru - 16 Apr 2008 16:01 GMT
Hello,

I am cvurrently running Excel 2007.

1.  Could somebody please tell me how to create a push button within a
worksheet.
2.  a macro that I can amend which when the buttonj is pressed will clear
various  
   cell ranges with in the worksheet.

I know it's a lot to ask but all help would be greatfully accepted.
Thanks in anticipation
Finance Guru
Wales - the land of fire breathing dragons and rugby playing wizards
NateBuckley - 16 Apr 2008 17:51 GMT
Hello,

In Excel go to View - Toolbars and select Control Toolbox. On the new set of
controls lies the command button tool. Click this (it's the square) and click
anywhere on your sheet.

Double click this button, and it will open the code area.

Beneath the line that says

Private Sub CommandButton1_Click()

Copy and paste the following

Sheets("Sheet1").Range("A1:A2").ClearContents

Replace Sheet1 with the name of your sheet, and put your own Range where it
says "A1:A2".

You can have multiple lines in this macro incase you want to delete around
something.

Hope this helped somewhat.

P.S Once you're on your sheet, make sure you click out of DESIGN Mode, the
button is blueish on the toolbar, this will make it possible to click the
button.

> Hello,
>
[quoted text clipped - 10 lines]
> Finance Guru
> Wales - the land of fire breathing dragons and rugby playing wizards
Finance Guru - 17 Apr 2008 12:03 GMT
Hi Nate,

Thanks for the respone.  I am new to Excel 2007.
If I go to View I cannot see the Control Toolbox anywhere. Any ideas on
where in 2007 I can find it?

Kind regards
Finance Guru.
Signature

Wales - the land of fire breathing dragons and rugby palaying wizards.

> Hello,
>
[quoted text clipped - 38 lines]
> > Finance Guru
> > Wales - the land of fire breathing dragons and rugby playing wizards
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.