ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Create OptionButton at run time (https://www.excelbanter.com/excel-programming/440471-create-optionbutton-run-time.html)

James

Create OptionButton at run time
 
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

Create OptionButton at run time
 
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

James

Create OptionButton at run time
 
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

Create OptionButton at run time
 
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


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com