ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Check Box reference name (https://www.excelbanter.com/excel-discussion-misc-queries/79979-check-box-reference-name.html)

Kris in Kenya

Check Box reference name
 
When I create a checkbox in multiple worksheets within the same document,
excel assigns different references to it - this has as a consequence I can
not assign the same workbook macro's (it inetract with 3 macro's) to it as it
has another reference and I would have to write as many macro's as I have
worksheets (30!) while in fact the function is the same - I cannot find any
way to chanjge the excel assigned reference

Dave Peterson

Check Box reference name
 
If you used a checkbox from the Forms toolbar, you'll be able to right click on
each and assign the same macro to each.

Kris in Kenya wrote:

When I create a checkbox in multiple worksheets within the same document,
excel assigns different references to it - this has as a consequence I can
not assign the same workbook macro's (it inetract with 3 macro's) to it as it
has another reference and I would have to write as many macro's as I have
worksheets (30!) while in fact the function is the same - I cannot find any
way to chanjge the excel assigned reference


--

Dave Peterson

Kris in Kenya

Check Box reference name
 
Hi Dave, thanks but that is not the issue, of course I can assign the macro
to any check_box - but since the macro's assigned and other macro's assigned
to radio_buttons all use the check_box in their VBA-code the check_boxes must
have the same reference - I did find an intermediate solution as follows:
In one of the sheets the check_box with the highest reference had
Check_Box_817 as a reference, I just went in all the other sheets where the
references ranged from 255 to 628 and in each of them copy/pasted the
original one as many times as needed to increase the reference to the same
817 - after a lot of copy/pasting (luckily you can group the pasted boxes
together so it goes faster) I ended up with having all my boxes having 817 as
a reference in each sheet - after which I could use that reference in the
macro's thus all pointing to an existing box in each sheet.

But of course a simple editing of the reference number would be more
convenient :-)

"Dave Peterson" wrote:

If you used a checkbox from the Forms toolbar, you'll be able to right click on
each and assign the same macro to each.

Kris in Kenya wrote:

When I create a checkbox in multiple worksheets within the same document,
excel assigns different references to it - this has as a consequence I can
not assign the same workbook macro's (it inetract with 3 macro's) to it as it
has another reference and I would have to write as many macro's as I have
worksheets (30!) while in fact the function is the same - I cannot find any
way to chanjge the excel assigned reference


--

Dave Peterson


Dave Peterson

Check Box reference name
 
If you select the checkbox, you can change its name by typing the new name in
the NameBox (to the left of the FormulaBar). (Remember to hit enter.)



Kris in Kenya wrote:

Hi Dave, thanks but that is not the issue, of course I can assign the macro
to any check_box - but since the macro's assigned and other macro's assigned
to radio_buttons all use the check_box in their VBA-code the check_boxes must
have the same reference - I did find an intermediate solution as follows:
In one of the sheets the check_box with the highest reference had
Check_Box_817 as a reference, I just went in all the other sheets where the
references ranged from 255 to 628 and in each of them copy/pasted the
original one as many times as needed to increase the reference to the same
817 - after a lot of copy/pasting (luckily you can group the pasted boxes
together so it goes faster) I ended up with having all my boxes having 817 as
a reference in each sheet - after which I could use that reference in the
macro's thus all pointing to an existing box in each sheet.

But of course a simple editing of the reference number would be more
convenient :-)

"Dave Peterson" wrote:

If you used a checkbox from the Forms toolbar, you'll be able to right click on
each and assign the same macro to each.

Kris in Kenya wrote:

When I create a checkbox in multiple worksheets within the same document,
excel assigns different references to it - this has as a consequence I can
not assign the same workbook macro's (it inetract with 3 macro's) to it as it
has another reference and I would have to write as many macro's as I have
worksheets (30!) while in fact the function is the same - I cannot find any
way to chanjge the excel assigned reference


--

Dave Peterson


--

Dave Peterson


All times are GMT +1. The time now is 08:35 PM.

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