ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Select All checkboxes (https://www.excelbanter.com/excel-discussion-misc-queries/189827-select-all-checkboxes.html)

Nikki

Select All checkboxes
 
Hi,

I'd like to create a button that will "select all" checkboxes on a
given worksheet. When I searched this group, I came across this
posting that looks like exactly what I need:
http://groups.google.com/group/micro...f0c0b1eaded911

However, I am not familiar with Visual Basic programming. When I
copied and pasted the code, I get an error at start of the For Each
command. What are "ctrl", "UserForm1" and "MSForms" pointing to? I
assume those are the variables to be set. How do I set them?

I appreciate any help or pointers where to search for help.

Thank you,
Nikki

Dave Peterson

Select All checkboxes
 
That thread dealt with checkboxes on a userform--not checkboxes placed on a
worksheet.

Where did you get your checkboxes that you placed on the worksheet--did you use
the checkboxes from the Forms toolbar or did you use the checkboxes from the
Control toolbox toolbar?

Nikki wrote:

Hi,

I'd like to create a button that will "select all" checkboxes on a
given worksheet. When I searched this group, I came across this
posting that looks like exactly what I need:
http://groups.google.com/group/micro...f0c0b1eaded911

However, I am not familiar with Visual Basic programming. When I
copied and pasted the code, I get an error at start of the For Each
command. What are "ctrl", "UserForm1" and "MSForms" pointing to? I
assume those are the variables to be set. How do I set them?

I appreciate any help or pointers where to search for help.

Thank you,
Nikki


--

Dave Peterson

Nikki

Select All checkboxes
 
Dave,

I used the checkboxes from the Forms toolbar.

I was unaware of a difference of a worksheet and userform; I am not
familiar with userforms.

Thank you,
Nikki

On Jun 3, 11:49*am, Dave Peterson wrote:
That thread dealt with checkboxes on a userform--not checkboxes placed on a
worksheet.

Where did you get your checkboxes that you placed on the worksheet--did you use
the checkboxes from the Forms toolbar or did you use the checkboxes from the
Control toolbox toolbar?





Nikki wrote:

Hi,


I'd like to create a button that will "select all" checkboxes on a
given worksheet. When I searched this group, I came across this
posting that looks like exactly what I need:
http://groups.google.com/group/micro...isc/browse_thr...


However, I am not familiar with Visual Basic programming. When I
copied and pasted the code, I get an error at start of the For Each
command. What are "ctrl", "UserForm1" and "MSForms" pointing to? I
assume those are the variables to be set. How do I set them?


I appreciate any help or pointers where to search for help.


Thank you,
Nikki


--

Dave Peterson- Hide quoted text -

- Show quoted text -



Dave Peterson

Select All checkboxes
 
Userforms are those things that look a lot like the Tools|Options dialog.

You could assign a macro like this to that master checkbox:

Option Explicit
Sub ToggleCheckboxes()
Dim MstrCBX As CheckBox
Set MstrCBX = ActiveSheet.CheckBoxes(Application.Caller)
ActiveSheet.CheckBoxes.Value = MstrCBX.Value
End Sub



Nikki wrote:

Dave,

I used the checkboxes from the Forms toolbar.

I was unaware of a difference of a worksheet and userform; I am not
familiar with userforms.

Thank you,
Nikki

On Jun 3, 11:49 am, Dave Peterson wrote:
That thread dealt with checkboxes on a userform--not checkboxes placed on a
worksheet.

Where did you get your checkboxes that you placed on the worksheet--did you use
the checkboxes from the Forms toolbar or did you use the checkboxes from the
Control toolbox toolbar?





Nikki wrote:

Hi,


I'd like to create a button that will "select all" checkboxes on a
given worksheet. When I searched this group, I came across this
posting that looks like exactly what I need:
http://groups.google.com/group/micro...isc/browse_thr...


However, I am not familiar with Visual Basic programming. When I
copied and pasted the code, I get an error at start of the For Each
command. What are "ctrl", "UserForm1" and "MSForms" pointing to? I
assume those are the variables to be set. How do I set them?


I appreciate any help or pointers where to search for help.


Thank you,
Nikki


--

Dave Peterson- Hide quoted text -

- Show quoted text -


--

Dave Peterson

Nikki

Select All checkboxes
 
Thank for your reply. Once I found out how to assign a macro to a
checkbox, this code worked perfectly.

Also, thank you for clarifying what a userform is. I did not know
Excel could do something like that. Guess we learn a lot more than one
thing each day!

Nikki

On Jun 3, 2:31*pm, Dave Peterson wrote:
Userforms are those things that look a lot like the Tools|Options dialog. *

You could assign a macro like this to that master checkbox:

Option Explicit
Sub ToggleCheckboxes()
* * Dim MstrCBX As CheckBox
* * Set MstrCBX = ActiveSheet.CheckBoxes(Application.Caller)
* * ActiveSheet.CheckBoxes.Value = MstrCBX.Value
End Sub





Nikki wrote:

Dave,


I used the checkboxes from the Forms toolbar.


I was unaware of a difference of a worksheet and userform; I am not
familiar with userforms.


Thank you,
Nikki


On Jun 3, 11:49 am, Dave Peterson wrote:
That thread dealt with checkboxes on a userform--not checkboxes placed on a
worksheet.


Where did you get your checkboxes that you placed on the worksheet--did you use
the checkboxes from the Forms toolbar or did you use the checkboxes from the
Control toolbox toolbar?


Nikki wrote:


Hi,


I'd like to create a button that will "select all" checkboxes on a
given worksheet. When I searched this group, I came across this
posting that looks like exactly what I need:
http://groups.google.com/group/micro...isc/browse_thr....


However, I am not familiar with Visual Basic programming. When I
copied and pasted the code, I get an error at start of the For Each
command. What are "ctrl", "UserForm1" and "MSForms" pointing to? I
assume those are the variables to be set. How do I set them?


I appreciate any help or pointers where to search for help.


Thank you,
Nikki


--


Dave Peterson- Hide quoted text -


- Show quoted text -


--

Dave Peterson- Hide quoted text -

- Show quoted text -



Dave Peterson

Select All checkboxes
 
If you decide to look into userforms, you can start he

http://contextures.com/xlUserForm01.html
(Debra Dalgleish's site)



Nikki wrote:

Thank for your reply. Once I found out how to assign a macro to a
checkbox, this code worked perfectly.

Also, thank you for clarifying what a userform is. I did not know
Excel could do something like that. Guess we learn a lot more than one
thing each day!

Nikki

On Jun 3, 2:31 pm, Dave Peterson wrote:
Userforms are those things that look a lot like the Tools|Options dialog.

You could assign a macro like this to that master checkbox:

Option Explicit
Sub ToggleCheckboxes()
Dim MstrCBX As CheckBox
Set MstrCBX = ActiveSheet.CheckBoxes(Application.Caller)
ActiveSheet.CheckBoxes.Value = MstrCBX.Value
End Sub





Nikki wrote:

Dave,


I used the checkboxes from the Forms toolbar.


I was unaware of a difference of a worksheet and userform; I am not
familiar with userforms.


Thank you,
Nikki


On Jun 3, 11:49 am, Dave Peterson wrote:
That thread dealt with checkboxes on a userform--not checkboxes placed on a
worksheet.


Where did you get your checkboxes that you placed on the worksheet--did you use
the checkboxes from the Forms toolbar or did you use the checkboxes from the
Control toolbox toolbar?


Nikki wrote:


Hi,


I'd like to create a button that will "select all" checkboxes on a
given worksheet. When I searched this group, I came across this
posting that looks like exactly what I need:
http://groups.google.com/group/micro...isc/browse_thr...


However, I am not familiar with Visual Basic programming. When I
copied and pasted the code, I get an error at start of the For Each
command. What are "ctrl", "UserForm1" and "MSForms" pointing to? I
assume those are the variables to be set. How do I set them?


I appreciate any help or pointers where to search for help.


Thank you,
Nikki


--


Dave Peterson- Hide quoted text -


- Show quoted text -


--

Dave Peterson- Hide quoted text -

- Show quoted text -


--

Dave Peterson


All times are GMT +1. The time now is 02:37 PM.

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