Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 84
Default Dynamically Added Control

I am building a form that dynamically adds a frame and set of radio buttons.
The number and name of the buttons will vary depending on how many cells are
filled in. What I want to do is then add some code to these radio buttons at
run time.

How do you add code to a control that is added at run time? The code I want
to attach to the control will, obviously, be written at design time.

Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Dynamically Added Control

Hi Bob,

See the methods used by John Walkenbach at:

http://www.j-walk.com/ss/excel/tips/tip76.htm



---
Regards,
Norman


"BobT" wrote in message
...
I am building a form that dynamically adds a frame and set of radio
buttons.
The number and name of the buttons will vary depending on how many cells
are
filled in. What I want to do is then add some code to these radio buttons
at
run time.

How do you add code to a control that is added at run time? The code I
want
to attach to the control will, obviously, be written at design time.

Thanks in advance.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Dynamically Added Control

Same site, but I would recommend this as an alternate approach:

http://www.j-walk.com/ss/excel/tips/tip44.htm

Just be aware that it won't work with Events provided by the control object
such as Exit, Enter, BeforeUpdate, AfterUpdate - only those native to the
OptionButton.

--
Regards,
Tom Ogilvy



"Norman Jones" wrote:

Hi Bob,

See the methods used by John Walkenbach at:

http://www.j-walk.com/ss/excel/tips/tip76.htm



---
Regards,
Norman


"BobT" wrote in message
...
I am building a form that dynamically adds a frame and set of radio
buttons.
The number and name of the buttons will vary depending on how many cells
are
filled in. What I want to do is then add some code to these radio buttons
at
run time.

How do you add code to a control that is added at run time? The code I
want
to attach to the control will, obviously, be written at design time.

Thanks in advance.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Dynamically Added Control

Have you thought about designing the userform for the worst case scenario?

Hide the buttons/frame/whatever. And only show what you need. Depending on
what you're doing, it may make your life a bit easier.

BobT wrote:

I am building a form that dynamically adds a frame and set of radio buttons.
The number and name of the buttons will vary depending on how many cells are
filled in. What I want to do is then add some code to these radio buttons at
run time.

How do you add code to a control that is added at run time? The code I want
to attach to the control will, obviously, be written at design time.

Thanks in advance.


--

Dave Peterson
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
Textbox added to Form at runtime too small, can't control size andchange event won't trigger RCGUA Excel Worksheet Functions 2 December 10th 08 09:34 PM
Can you dynamically expand the time range to the series data added Rubbs Charts and Charting in Excel 2 December 5th 07 04:06 PM
updating caption of added control [email protected] Excel Programming 3 January 24th 07 05:35 PM
Hyperlink added to an activex control button Dimmer Excel Discussion (Misc queries) 1 August 11th 05 03:06 PM
How to determine which dynamically generated control was clicked llowwelll[_7_] Excel Programming 4 May 23rd 04 09:26 PM


All times are GMT +1. The time now is 01:48 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"