How about an alternative?
Instead of using a bunch of optionbuttons (in pairs in groupboxes), couldn't you
use a single checkbox to replace the pair of optionbuttons. If it's checked,
then it's yes. If it's not checked then it's no.
========
From your description, you're using a worksheet and making it look like a form
to the user. This is different from a UserForm. (Rick missed this when he read
your original post.)
UserForms look like the builtin dialogs that you see in excel--like when you use
Tools|Options.
========
#1. You can hide the groupboxes, but you need to use code.
If you don't want to use checkboxes instead of pairs of optionbuttons, then you
can do this:
Select the worksheet with the optionbuttons (and groupboxes)
Hit alt-f11 to get to the VBE (where macros and UserForms live)
hit ctrl-g to see the immediate window
Type this and hit enter
activesheet.groupboxes.visible = false
When you want to see them again, do the same thing, but change that False to
True.
Then close the VBE window and go back to excel to see if it worked ok.
#2. You can actually use code to locate the optionbuttons and groupboxes so
that they're aligned nicely.
But you can also hit and hold the alt key while you position the groupboxes.
They'll snap-to the cell borders.
You can also select the groupboxes (click on the first and ctrl-click on the
others), then show the Drawing toolbar.
Click on the Draw dropdown and choose align/nudge and other shape adjustment
stuff.
#3. You can use code to turn off each option button, but maybe defaulting to No
(or yes) would be better. That way the user can "skip" the questions that don't
change.
#4. You used the buttons from that same Forms toolbar, right?
You can select the text in the button and use formatting buttons (font size/font
color) for the selected text. Yep, you can change formatting for individual
characters.
=======
This kind of sounds like a survey form you're making.
You may want to look at this page on Debra Dalgleish's site:
http://contextures.com/xlForm01.html
If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
Idaho Word Man wrote:
I am a beginner in Excel, so don't get mad if my questions are rather basic.
I've searched through previous posts, but I haven't been able to find answers
to these questions.
I'm trying to create a form in Excel with 42 yes/no questions. I used pairs
of Option Buttons from the Forms toolbar for each question. I have placed a
group box around each pair and I have used Ctrl-Click and then Group to group
each pair into a group box. The buttons seem to work OK, so I'm feeling
pretty good so far.
Here are my questions:
1. Is there a way to get rid of the lines and labels on the group boxes?
I've tried Format Object - Colors and Lines, and I've tried No Line and I've
tried a white line, but they still have a line around them. How do you get
rid of the lines?
2. Is there a way to make the group boxes exactly the same size so I can
align my buttons evenly? My group boxes don't snap to a grid, and I have to
draw each one by hand, so they're all a little different, and the buttons are
aligned within each box a little different. I've tried copying and pasting a
box, but the pasted box has the same number as the original.
3. Is there a way to unselect a button if I accidentally click on it? I
want the default value of all of them to be unclicked when the user opens the
form, but if I accidentally click one, it seems to be clicked forever.
4. Is there any way to set the font or font size on the labels for the
buttons?
I'm using Windows XP Professional with Office 2003.
Thanks in advance for any help you can provide.
Fred
--
Dave Peterson