Okay try this workbook.
Not sure how your workbook got to 10mb, but it's now 180kb and a bit more manageable.
The first thing to do is organise your workbook
With Sheet "Data"
1/. Sort each Set of lists e.g. "A CODE" and "A DESC"
Sort on "A DESC" > A-Z
Then by "A CODE" > Smallest to Largest
2/. Insert a Column after these two columns, call this Column "A DESC UNIQUE"
Then in
In row 2 of this column (F2)
Drag/ Fill Down
If your maximum column depth exceeds row 2000 the change the formula to cover what can reasonably expected and a bit more.
Create two Named Ranges "A_DESC" and "A_DESC_UNIQUE" (Note the underscores)
"A_DESC" is dynamic, you can add to this as you wish, if you delete a description, resort the lists so that you have an unbroken list of descriptions.
Name:= "A_DESC"
Refers To:=
"A_DESC_UNIQUE" will be used as data validation, it reduces your drop-downs to a more manageable length, but can't be dynamic as it will be called indirectly later on
Name:= "A_DESC_UNIQUE"
Refers To:=
Unfortunately this list will end with a lot of blanks, if you see a blank drop-down when this is called just scroll up.
Repeat similarly for all other groups, and any more you might want to add.
3/. Add a dynamic name for your companies
Name:= "COMPANY"
Refers To:=
Add to this list as required, but keep the list continuous, no blanks.
These wont be A,B,C, etc in reallity, so if "A" becomes "Fred Bloggs Ltd", then the lookup names "A_DESC" and "A_DESC_UNIQUE" must be changed to "Fred_Bloggs_Ltd_DESC" and "Fred_Bloggs_Ltd_DESC_UNIQUE" (again note the underscores)
For this reason best keep the names to short unique aliases, and later use these to lookup further details.
4/. With Sheet "Report"
Data Validation in Column "B"
Allow:= List
Source :=
5/. This code in the worksheet module should take care of the rest
Give it a go and let me know if it suits your needs.
Bookmarks