LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 148
Default How to add a command button and on-click within vba

My project I am working on does a lot of formating, reorganizing, and
calculations with VBA. When the code is done, I have a sheet that
"summarizes" what has been done through a "grading" scheme that my boss wants.

However, as the end-users analyze the data generated, we tweak the arrays or
ranges as necessary. When we do this, the data underlying the scores change,
thereby affecting the scores.
What I want to do is add a command button to my score sheet that, when
clicked, will re-run the scoring macro and update the scoring summary.

I am able to get the button to appear, but I can not figure out how to tell
the code what I want it to do when I click it.
Where I am getting confused is: I can add the button, change the caption
etc. I can even write the macro for it to follow "on-click". Where I get
lost is - when I try to include this into the vba code that is driving the
whole thing.

Below is the code that is used to draw the button. How do I modify this to
tell it to run the on-click macro?

ActiveSheet.OLEObjects.Add(ClassType:="Forms.Comma ndButton.1",
Link:=False _
, DisplayAsIcon:=False, Left:=31.2, Top:=240.6, Width:=85.2,
Height:= _
33.6).Select

 
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
Remove Command Button After Click andiam24 Excel Discussion (Misc queries) 4 April 1st 09 04:51 PM
Command Button Click bmolintas Excel Discussion (Misc queries) 4 November 8th 07 10:37 PM
further options following a command button click thesaxonuk Excel Discussion (Misc queries) 0 October 23rd 06 01:46 PM
Is there any way to have a maco click a command button ChairMan Excel Discussion (Misc queries) 0 March 23rd 06 03:58 PM
Linking one worksheet to another by click on a command button Ken Vo Excel Discussion (Misc queries) 0 January 6th 06 12:41 AM


All times are GMT +1. The time now is 08:34 AM.

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"