PC Review


Reply
Thread Tools Rate Thread

Create OptionButton at run time

 
 
James
Guest
Posts: n/a
 
      10th Mar 2010
I their a way I can create an option button at run time using vba and place
it on a specific worksheet named "Admin" Thanks.
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      10th Mar 2010
You could. But if you have code associated with this optionbutton, it'll get
messy really quickly.

Instead, you could create the optionbutton and hide it. Just make it visible
when you want to see it.

If you need help, what kind of optionbutton is it?

Is it from the Forms toolbar or is it from the control toolbox toolbar?

What's the name of the optionbutton?

And when should it be made visible (and when/if should it be hidden)?

James wrote:
>
> I their a way I can create an option button at run time using vba and place
> it on a specific worksheet named "Admin" Thanks.


--

Dave Peterson
 
Reply With Quote
 
James
Guest
Posts: n/a
 
      10th Mar 2010
The problem with hiding it is I do not know how many I need to make. I am
returning the names of all the worksheets from another workbook and it will
vary.
For each name retrieved I want an optionbutton (optionbutton1,
optionbutton2...)
I am using the control from the controls toolbox, thanks.


"Dave Peterson" wrote:

> You could. But if you have code associated with this optionbutton, it'll get
> messy really quickly.
>
> Instead, you could create the optionbutton and hide it. Just make it visible
> when you want to see it.
>
> If you need help, what kind of optionbutton is it?
>
> Is it from the Forms toolbar or is it from the control toolbox toolbar?
>
> What's the name of the optionbutton?
>
> And when should it be made visible (and when/if should it be hidden)?
>
> James wrote:
> >
> > I their a way I can create an option button at run time using vba and place
> > it on a specific worksheet named "Admin" Thanks.

>
> --
>
> Dave Peterson
> .
>

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      10th Mar 2010
What's the largest number that you think you'd need? Double it and add some
fudge factor.

I don't know what you're doing with this, but if I wanted to select a single
worksheet, I'd use a combobox.

If I want to (possibly) select multiple sheets, then I'd use a listbox with
multiselect:=true.

Or I'd use a simple value (like X) in a column.

James wrote:
>
> The problem with hiding it is I do not know how many I need to make. I am
> returning the names of all the worksheets from another workbook and it will
> vary.
> For each name retrieved I want an optionbutton (optionbutton1,
> optionbutton2...)
> I am using the control from the controls toolbox, thanks.
>
> "Dave Peterson" wrote:
>
> > You could. But if you have code associated with this optionbutton, it'll get
> > messy really quickly.
> >
> > Instead, you could create the optionbutton and hide it. Just make it visible
> > when you want to see it.
> >
> > If you need help, what kind of optionbutton is it?
> >
> > Is it from the Forms toolbar or is it from the control toolbox toolbar?
> >
> > What's the name of the optionbutton?
> >
> > And when should it be made visible (and when/if should it be hidden)?
> >
> > James wrote:
> > >
> > > I their a way I can create an option button at run time using vba and place
> > > it on a specific worksheet named "Admin" Thanks.

> >
> > --
> >
> > Dave Peterson
> > .
> >


--

Dave Peterson
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run-time 438 - OptionButton troubles Luke Microsoft Excel Programming 4 20th Feb 2010 01:36 PM
Create dictionary of terms, create first time user site =?Utf-8?B?U29saXRhaXJlIEphbmUgQXVzdGlu?= Microsoft Excel New Users 1 19th Jan 2006 09:47 PM
Optionbutton help Craig Microsoft Excel Programming 5 25th Nov 2005 10:04 PM
for each optionbutton masterphilch Microsoft Excel Programming 1 21st Sep 2005 05:37 PM
Re: OptionButton nrage21 Microsoft Excel Programming 0 29th Sep 2004 12:23 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:13 AM.