Excel VBA - Arrays for Data Validation Reference

后端 未结 2 553
失恋的感觉
失恋的感觉 2021-01-26 14:14

I have the following code:

Sub TEST_____________Data_Validation_Machine()

Application.ScreenUpdating = False

Dim ws As Worksheet
Dim ws2 As Worksheet
Dim Range         


        
2条回答
  •  孤独总比滥情好
    2021-01-26 14:42

    Is there any reason you're using VBA to accomplish this?

    There's plenty of examples on Google showing how to accomplish this with named ranges, and an example I wrote up some time back that shows how you can use a Table to host your lists that allows cascading DV many levels deep, at the following links:

    • https://chandoo.org/wp/2014/02/13/dynamic-cascading-dropdowns-that-reset/ (using VBA to reset 'downstream" DV if upstream DV later changes)
    • https://chandoo.org/wp/2014/02/25/robust-dynamic-cascading-dropdowns-without-vba/ (using formulas to stop users changing upstream DV unless downstream DV changed).

提交回复
热议问题