Controls in a Worksheet

G

Guest

Hello,

What I would like to accomplish is to insert a "Frame" control & then add
"Option buttons" to the Frame for the User to select & then with VBA to
manipulate them.

I first tried using the FORMS Toolbar controls. The work how ever u then
have no control over them with VBA, or if u do I dont know how, perhaps
someone can exlpain that to me, for example to make them Visible or not.

Then I tried using the CONTROL TOOLBOX controls.
With these u can control them with VBA. However,
this for some reason doesnt have a "Frame" control, but I as able to add one
by selecting the "More Controls" toolbar & then find the "Microsoft Forms 2.0
Frame"
When I add this "Frame" to my worksheet & then add the Option Button on top
of the Frame, when I exit out of Design Mode the Option Buttons dissapear,
sort of goes behind the Frame. The CONTROL TOOLBOX controls work for me
better becuase then I can use VBA coding to manipulate them, but now I am
experiencing the above problem. How can this be fixed ?

Any help would be greatly appreciated.

Thank you,
Jeff
 
T

Tom Ogilvy

Frames from the msforms 2.0 library (control toolbox controls) do not work
on an excel worksheet. Your first hint should have been that they do not
appear on the control toolbox when the worksheet has the focus.
 
G

Guest

Hi Tom,

Than you, but do you have an answer as to how I can include a Frame & Option
buttons on my worksheet that I can control with VBA ?

Thank you,
Jeff
 
D

Dave Peterson

You can control the optionbuttons from the forms toolbar in VBA.

Dim myOptBtn As OptionButton
Set myOptBtn = ActiveSheet.OptionButtons("option button 1")
With myOptBtn
.Value = xlOn 'xloff
.Visible = True
.Caption = "hi there"
End With
 
T

Tom Ogilvy

What are you trying to achieve with the Frame. If you want to use it to
group the option buttons, just use the groupname property. Assign any name
as long as it is common to the optionbuttons in the group.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top