Forum Discussion
Multi Select & Dependent Drop Downs
- Mar 24, 2024
See the attached version.
UpdateValidation now lets you specify an arbitrary number of other columns to be affected, by specifying their offsets.
In the Worksheet_Change event procedure,when column A is modified, the line
Call UpdateValidation(Target, 1, 5)
updates the data validation source for the columns 1 and 5 to the right of column A, i.e. columns B and F.
If you wanted to add column H (7 to the right of column A), you'd use
Call UpdateValidation(Target, 1, 5, 7)
Marking my reply was in error, wanted to mark your first response.
See the attached version.
UpdateValidation now lets you specify an arbitrary number of other columns to be affected, by specifying their offsets.
In the Worksheet_Change event procedure,when column A is modified, the line
Call UpdateValidation(Target, 1, 5)
updates the data validation source for the columns 1 and 5 to the right of column A, i.e. columns B and F.
If you wanted to add column H (7 to the right of column A), you'd use
Call UpdateValidation(Target, 1, 5, 7)
- Missile64Mar 30, 2024Copper ContributorAh so simple, thanks very much.
- HansVogelaarMar 29, 2024MVP
Specify List in the allow drop down, then enter a space in the Source box.
The VBA code will change the source when you select something in column A.
- Missile64Mar 29, 2024Copper ContributorHans,
One last question. With regards to the Data Validation Drop downs in Columns B & F what is entered into the 'Source: field' when setting up the Data Validation List?
To test it I tried to also include Column G as a dependent drop down. I this part of the code from 'Call UpdateValidation(Target, 1, 5)' to Call UpdateValidation(Target, 1, 5, 6). But having issues with creating the Drop Down list in Column G.
Thanks
Pete - Missile64Mar 25, 2024Copper Contributor