Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default push button question

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 146
Default push button question

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.

"Finance Guru" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default push button question

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.
--
Wales - the land of fire breathing dragons and rugby palaying wizards.


"NateBuckley" wrote:

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.

"Finance Guru" wrote:

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

Reply
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
Push button and input box? tripflex Excel Discussion (Misc queries) 2 March 6th 09 03:36 PM
Time with the push of one button Dale G[_2_] New Users to Excel 7 August 6th 08 01:55 PM
push a command button donbowyer Excel Programming 3 September 10th 06 12:36 AM
Push the button chris Excel Programming 1 August 3rd 05 04:07 PM
Which button did I push Daniel Bonallack[_2_] Excel Programming 4 May 20th 04 09:12 PM


All times are GMT +1. The time now is 07:16 PM.

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

About Us

"It's about Microsoft Excel"