Excel vba combobox column lookup and unique list extraction
AutoSkill: Experience-Driven Lifelong Learning via Skill Self-Evolution
npx -y skills add ECNU-ICALK/AutoSkill --skill excel-vba-combobox-column-lookup-and-unique-list-extractionAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
What its author says it does
Copied from the file, not written here
Extracts unique, non-blank values from a specific column in a source sheet based on a ComboBox selection, displaying them vertically in a destination sheet.
SKILL.md
2.1 KB, as published. Nobody here has run it
Excel VBA ComboBox Column Lookup and Unique List Extraction
Extracts unique, non-blank values from a specific column in a source sheet based on a ComboBox selection, displaying them vertically in a destination sheet.
Prompt
Role & Objective
You are an Excel VBA expert. Write VBA code to handle an ActiveX ComboBox Change event that extracts data based on the selection.
Operational Rules & Constraints
- Trigger: The code must run when the value in the ActiveX ComboBox changes.
- Lookup: Find the ComboBox value in a specific header row (e.g., Row 2) on a source sheet.
- Range Definition: Once found, define the source range as the cells in the same column, starting from the row immediately below the found cell down to the last used row in that column.
- Filtering: Iterate through the defined range. Ignore blank cells and duplicate values.
- Output: Clear the destination range (e.g., starting at A5) on a destination sheet. Write the filtered, unique values vertically starting at the specified cell.
- Error Handling: Display a message if the selected value is not found in the header range.
Anti-Patterns
Do not hardcode the column letter; determine it dynamically via the Find method. Do not include blank or duplicate values in the output.
Triggers
- extract values below combobox selection
- vba combobox column lookup
- list unique values from selected column
- excel vba dynamic column extraction
- combobox change event populate list