ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Automating a checklist (https://www.excelbanter.com/excel-programming/343275-automating-checklist.html)

FMW

Automating a checklist
 
I'm trying to automate a list so that when I select a control 'checkbox'
several sub-boxes will be selecting. The best way I can think of to describe
the functionality I'm after is to think of a grocery list. If my menu item
is on top of the list (spaghetti, chicken dinner, etc) and I check it all of
the ingredients boxes in the shopping list will automatically be selected.

Can excel help?

JNW

Automating a checklist
 
Place in the code for the sheet or userform (wherever you have the checkboxes)

Private Sub SpaghettiCheckBox_Change() 'this is the master checkbox
If SpaghettiCheckBox.value = true then
''these are ones that are changed when the master is checked
PastaCheckBox.value = true
SauceCheckBox.value = true
ParmeseanCheckBox.value = true
End if
end sub

You'll have to do this for all your checkboxes (make sure you change the
names as well! I just went along with your grocery example)

"FMW" wrote:

I'm trying to automate a list so that when I select a control 'checkbox'
several sub-boxes will be selecting. The best way I can think of to describe
the functionality I'm after is to think of a grocery list. If my menu item
is on top of the list (spaghetti, chicken dinner, etc) and I check it all of
the ingredients boxes in the shopping list will automatically be selected.

Can excel help?


FMW

Automating a checklist
 
I must still be doing something wrong. I'm using a control form and using
checkboxes. In my VB form (this comes up automatically when I double click
the control when in Design mode nothing is happening :

Private Sub CheckBox2_Click()
If CheckBox2.Value = True Then
CheckBox1.Value = True
End If
End Sub

Any suggestions? Sorry, I'm new to this coding stuff....

"JNW" wrote:

Place in the code for the sheet or userform (wherever you have the checkboxes)

Private Sub SpaghettiCheckBox_Change() 'this is the master checkbox
If SpaghettiCheckBox.value = true then
''these are ones that are changed when the master is checked
PastaCheckBox.value = true
SauceCheckBox.value = true
ParmeseanCheckBox.value = true
End if
end sub

You'll have to do this for all your checkboxes (make sure you change the
names as well! I just went along with your grocery example)

"FMW" wrote:

I'm trying to automate a list so that when I select a control 'checkbox'
several sub-boxes will be selecting. The best way I can think of to describe
the functionality I'm after is to think of a grocery list. If my menu item
is on top of the list (spaghetti, chicken dinner, etc) and I check it all of
the ingredients boxes in the shopping list will automatically be selected.

Can excel help?


JNW

Automating a checklist
 
Where are your checkboxes located? Are they on a Userform, or directly on
the sheet? And if directly on the sheet, are you using the control toolbox
toolbar, or the forms toolbar?

"FMW" wrote:

I must still be doing something wrong. I'm using a control form and using
checkboxes. In my VB form (this comes up automatically when I double click
the control when in Design mode nothing is happening :

Private Sub CheckBox2_Click()
If CheckBox2.Value = True Then
CheckBox1.Value = True
End If
End Sub

Any suggestions? Sorry, I'm new to this coding stuff....

"JNW" wrote:

Place in the code for the sheet or userform (wherever you have the checkboxes)

Private Sub SpaghettiCheckBox_Change() 'this is the master checkbox
If SpaghettiCheckBox.value = true then
''these are ones that are changed when the master is checked
PastaCheckBox.value = true
SauceCheckBox.value = true
ParmeseanCheckBox.value = true
End if
end sub

You'll have to do this for all your checkboxes (make sure you change the
names as well! I just went along with your grocery example)

"FMW" wrote:

I'm trying to automate a list so that when I select a control 'checkbox'
several sub-boxes will be selecting. The best way I can think of to describe
the functionality I'm after is to think of a grocery list. If my menu item
is on top of the list (spaghetti, chicken dinner, etc) and I check it all of
the ingredients boxes in the shopping list will automatically be selected.

Can excel help?


FMW

Automating a checklist
 
The checkboxes are directly on the Excel sheet and I'm using a control
toolbox toolbar. FYI - I'm not sure what I did but the code appears to be
working. In fact I added in a statement saying if 'false' then all 'false'
to deselect.

Thanks for your help! I'll let you know if I get stuck again. FYI - I am
using this to automate our project teams. If a certain type of project is
selected the developers eligible to work on that project are highlighted.

"JNW" wrote:

Where are your checkboxes located? Are they on a Userform, or directly on
the sheet? And if directly on the sheet, are you using the control toolbox
toolbar, or the forms toolbar?

"FMW" wrote:

I must still be doing something wrong. I'm using a control form and using
checkboxes. In my VB form (this comes up automatically when I double click
the control when in Design mode nothing is happening :

Private Sub CheckBox2_Click()
If CheckBox2.Value = True Then
CheckBox1.Value = True
End If
End Sub

Any suggestions? Sorry, I'm new to this coding stuff....

"JNW" wrote:

Place in the code for the sheet or userform (wherever you have the checkboxes)

Private Sub SpaghettiCheckBox_Change() 'this is the master checkbox
If SpaghettiCheckBox.value = true then
''these are ones that are changed when the master is checked
PastaCheckBox.value = true
SauceCheckBox.value = true
ParmeseanCheckBox.value = true
End if
end sub

You'll have to do this for all your checkboxes (make sure you change the
names as well! I just went along with your grocery example)

"FMW" wrote:

I'm trying to automate a list so that when I select a control 'checkbox'
several sub-boxes will be selecting. The best way I can think of to describe
the functionality I'm after is to think of a grocery list. If my menu item
is on top of the list (spaghetti, chicken dinner, etc) and I check it all of
the ingredients boxes in the shopping list will automatically be selected.

Can excel help?


JNW

Automating a checklist
 
Glad I could help! Let me know if there is anything else you need.

"FMW" wrote:

The checkboxes are directly on the Excel sheet and I'm using a control
toolbox toolbar. FYI - I'm not sure what I did but the code appears to be
working. In fact I added in a statement saying if 'false' then all 'false'
to deselect.

Thanks for your help! I'll let you know if I get stuck again. FYI - I am
using this to automate our project teams. If a certain type of project is
selected the developers eligible to work on that project are highlighted.

"JNW" wrote:

Where are your checkboxes located? Are they on a Userform, or directly on
the sheet? And if directly on the sheet, are you using the control toolbox
toolbar, or the forms toolbar?

"FMW" wrote:

I must still be doing something wrong. I'm using a control form and using
checkboxes. In my VB form (this comes up automatically when I double click
the control when in Design mode nothing is happening :

Private Sub CheckBox2_Click()
If CheckBox2.Value = True Then
CheckBox1.Value = True
End If
End Sub

Any suggestions? Sorry, I'm new to this coding stuff....

"JNW" wrote:

Place in the code for the sheet or userform (wherever you have the checkboxes)

Private Sub SpaghettiCheckBox_Change() 'this is the master checkbox
If SpaghettiCheckBox.value = true then
''these are ones that are changed when the master is checked
PastaCheckBox.value = true
SauceCheckBox.value = true
ParmeseanCheckBox.value = true
End if
end sub

You'll have to do this for all your checkboxes (make sure you change the
names as well! I just went along with your grocery example)

"FMW" wrote:

I'm trying to automate a list so that when I select a control 'checkbox'
several sub-boxes will be selecting. The best way I can think of to describe
the functionality I'm after is to think of a grocery list. If my menu item
is on top of the list (spaghetti, chicken dinner, etc) and I check it all of
the ingredients boxes in the shopping list will automatically be selected.

Can excel help?



All times are GMT +1. The time now is 09:55 PM.

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