Hey everone,
I have an interesting question... I have 20 dropdown boxes that each contain 'Yes' & 'No' we are looking to have a button assigned to a macro to toggle all of them at once. Reasoning is if it is a Yes, there is other code that acts upon the Yes, and triggers an e-mail.
If they are set to Yes, we would want to toggle all to No. and If they all contain No, we would want to toggle to Yes.
Any Ideas?
Thanks,
Brad
Change several Dropdown box values at once
-
- 4StarLounger
- Posts: 538
- Joined: 30 Mar 2010, 18:49
- Location: United States
-
- Administrator
- Posts: 78523
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Change several Dropdown box values at once
What kind of dropdown boxes are these?
- On a worksheet, from the Forms toolbar.
- On a worksheet, from the Control Toolbox.
- On a userform (created in the Visual Basic Editor)
- Are there other dropdown boxes than the 20 you mention?
- Have you given them consistent names, for example ComboBox1, ComboBox2, ..., ComboBox20 ?
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 538
- Joined: 30 Mar 2010, 18:49
- Location: United States
Re: Change several Dropdown box values at once
Hans,
There are 2 columns. They are pulling the Yes/No from a different set of cells on the same tab. Looks like they are suing data validation to populate the list.
There are 2 columns. They are pulling the Yes/No from a different set of cells on the same tab. Looks like they are suing data validation to populate the list.
-
- Administrator
- Posts: 78523
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Change several Dropdown box values at once
OK, so you need to set the values of a range of cells to 'Yes' or to 'No'. What is the range?
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 538
- Joined: 30 Mar 2010, 18:49
- Location: United States
Re: Change several Dropdown box values at once
Range of cells is E2:24
Brad
Brad
-
- Administrator
- Posts: 78523
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Change several Dropdown box values at once
You could use code like this in a macro:
Code: Select all
If Range("E2") = "No" Then
Range("E2:E24") = "Yes"
Else
Range("E2:E24") = "No"
End If
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 538
- Joined: 30 Mar 2010, 18:49
- Location: United States
Re: Change several Dropdown box values at once
Coolness.
Thanks and have a great weekend!
Brad
Thanks and have a great weekend!
Brad
-
- Administrator
- Posts: 78523
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands