Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Naming of Checkboxes

  Asked By: Muaz    Date: Nov 22    Category: MS Office    Views: 741
  

Newbie question here.

Is there a way to change the name of a checkbox that has been
manually added to a sheet (using the forms tool bar)?

I have added/deleted numerous check boxes (to several different
sheets) and have noticed that each one appears to get assigned a
default name in the form of CheckBoxnn (where nn is a sequential
number).

Now that I have the checkboxes properly "laid-out", I want to create
& assign macros. I know to Right-click > Assign Macro in order to
assign a macro, but am getting confused with the Default names and
would like to assign my own names to the checkboxes, if possible.
Properties for the individual checkboxes doesn't seem to offer the
ability to rename.

What am I missing?

Share: 

 

7 Answers Found

 
Answer #1    Answered By: Shannon Hughes     Answered On: Nov 22

Yes there is.

You will need the properties  pop-up window. It's the same one you can get on
the VBA editor, but you'll need it on the Excel side.

I don't know how to get at it from the ordinary menu structure (although it's
probably buried there somewhere), but there are a couple of other ways.

Bring up the control toolbox toolbar. (Right click on the toolbar area and
select "control toolbox".) That should have a properties icon - probably as the
second from the left. Click that icon and the properties pop-up will ... pop
up. You'll also need to go into design mode, if you're not there already. That
should be the leftmost icon in the same toolbar. Then click on your button and
its properties will show in the properties box. Then just change  the name of
the button.

Alternatively, go into design mode then right-click on the button and select
properties.

Remember that you'll need to change the names  of any event subroutines you've
already defined for the buttons. VBA will not detect any old subroutines as
being orphans, it just won't use them.

If you don't already have event subroutines (or even if you do), just
double-click the button while still in design mode and Excel will take you to
the click handler for the button (creating it for you if it doesn't already
exist).

 
Answer #2    Answered By: Clinton Edwards     Answered On: Nov 22

If I understood correctly the question, it is not a control from the "control"
toolbar but from the "form" toolbar. It is quite different.
There is no problem indeed to change  the name of an activeX control (the one
from the control toolbar).
But, I was surprised to see that this is not the case with a control added
from the "form" toolbar. I do not see where to change the default  name in this
case.

 
Answer #3    Answered By: Adelaide Fischer     Answered On: Nov 22

He's asking about a checkbox  from the Forms toolbar, not the Controls
toolbar. You can't use Design Mode on the old Forms objects.

 
Answer #4    Answered By: Blake Smith     Answered On: Nov 22

I missed that bit. I hate those buttons and quickly convert them
to control toolbox ones whenever they appear in stuff I'm working on. :-)

I've just had a bit of a play with a form  button, and I don't think it actually
has a name as such. (Or at least not a visible one.)

What happens is that the button can be associated with a subroutine and you have
the ability both to name this subroutine and to record actions for it. Excel
provides a default  name for this subroutine.

I just created a button and it brought up the assign  macro popup. It wanted to
assign to "Button1_Click". I changed the name of the macro  to "Fred" and then
hit record and recorded some stuff. Once I'd finished the recording, my Module1
VBA module had only a "Fred" subroutine in it.

Similarly, you can change  the name of the subroutine attached to an existing
button. Best way is to create the new subroutine first, then go to the "assign
macro" for the button and you'll see the new subroutine in the list. Select it
and the old identity seems pretty much gone.

 
Answer #5    Answered By: Ryder Anderson     Answered On: Nov 22

As I read your question, you are asking about checkboxes  from the "Forms"
toolbar and not the "Controls" toolbar.

To rename checkboxes that are on a worksheet from the Forms toolbar . . .
- select the checkbox  on the worksheet by Ctrl+click with mouse
- when the checkbox is active or selected, click on the Name box on the
Formula bar and type a new name
- hit enter or click outside the name box
I usually use a naming  convention for checkboxes like cbMyName, where MyName
is descriptive of the checkbox.

 
Answer #6    Answered By: Angelica Ramos     Answered On: Nov 22

I think my findings are the same ... I don't think that form  checkboxes
actually have visible names. You can assign  the click to a subroutine of any
name, and you can assign the checkbox  to any cell you like.

 
Answer #7    Answered By: Lonnie Rogers     Answered On: Nov 22

While my original post was regarding a
series of checkboxes  created from the "forms" toolbar (chosen because it was
easier for me to figure out how format the fill color/border by changing a
cell's formatting and dropping a transparent checkbox  over the cell), I have
since abandoned them in favor of a single button that opens a traditional
UserForm where the user selects their options.

 
Didn't find what you were looking for? Find more on Naming of Checkboxes Or get search suggestion and latest updates.




Tagged: