ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   "Select All" checkbox (or any other form tool) (https://www.excelbanter.com/excel-programming/347748-select-all-checkbox-any-other-form-tool.html)

[email protected]

"Select All" checkbox (or any other form tool)
 
Hello,

I need to be able to check off one box and have an entire section of
boxes be checked off with it )like on a website form).

What's the best way to go about doing this? Can a function be used, or
does it have to be a macro?

I'm not a great excel programmer, so, please, be gentle...

Thanks very much,
Bill


Jim Thomlinson[_4_]

"Select All" checkbox (or any other form tool)
 
That can only be done with a macro. There are two types of check boxes that
you might have. One comes off the forms toolbar and the other comes off the
Control Toolbox. They are different. My preference would be to use the ones
off of the Control Toolbox for this but either one will work.
--
HTH...

Jim Thomlinson


" wrote:

Hello,

I need to be able to check off one box and have an entire section of
boxes be checked off with it )like on a website form).

What's the best way to go about doing this? Can a function be used, or
does it have to be a macro?

I'm not a great excel programmer, so, please, be gentle...

Thanks very much,
Bill



[email protected]

"Select All" checkbox (or any other form tool)
 
Ok, thanks. Now how would I do that? Sorry, I'm new to this.

Bill


Jim Thomlinson[_4_]

"Select All" checkbox (or any other form tool)
 
Sorry about being gone so long... Christmas Lunch. I just can't pass up free
food.

Try this. Check boxes are from the control toolbox. My assumption is that
the first box added is the one you want to be the select all.

Private Sub CheckBox1_Click()
Dim cbx As OLEObject
Dim wks As Worksheet

Set wks = Sheets("Sheet1")
For Each cbx In wks.OLEObjects
If cbx.OLEType = 2 Then
If CheckBox1.Value = True Then
cbx.Object.Value = True
Else
cbx.Object.Value = False
End If
End If
Next cbx
End Sub

--
HTH...

Jim Thomlinson


" wrote:

Ok, thanks. Now how would I do that? Sorry, I'm new to this.

Bill




All times are GMT +1. The time now is 08:58 AM.

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