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: 26
Default Control Click Subroutine (BHatMJ)

HELP! I am adding a dynamic number of control buttons to a worksheet
dependent upon user input during run time (see my code below). I need to add
code to each of these buttons (also during run time) so that a subroutine is
called when the user selects the button.

ANY help would be greatly appreciated!!!




Sub AddCtrl(nCnt As Integer)

topPos = 20
' nCnt is an integer set at run time by the user
For lp = 1 to nCnt
ActiveSheet.OLEObjects.Add(ClassType:="Forms.Comma ndButton.1", Left:=100,
Top:=topPos, Width:=50, Height:= 30).Select
topPos = topPos + 75
Next lp

End Sub
 
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
Call a subroutine using variable subroutine name dhstein Excel Discussion (Misc queries) 3 July 26th 09 08:28 PM
How To Quit Subroutine from a called subroutine Rich J[_2_] Excel Programming 5 February 20th 07 06:48 PM
Second Click on Control Button iamjbunni Excel Programming 4 August 1st 06 10:51 PM
Why does the click event get control? Lee Hunter Excel Programming 1 October 31st 05 06:26 PM
Click on Image Control disables it Wexler Excel Programming 0 October 7th 03 05:35 PM


All times are GMT +1. The time now is 06:35 AM.

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"