agentsclimarketplace

Excel vba dynamic column extraction from combobox selection

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt4_8/excel-vba-dynamic-column-extraction-from-combobox-selection

AutoSkill: Experience-Driven Lifelong Learning via Skill Self-Evolution

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill excel-vba-dynamic-column-extraction-from-combobox-selection

Assembled 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

Generates VBA code to extract unique, non-blank values from a specific column in a source sheet based on a ComboBox selection, outputting them vertically to a destination sheet.

SKILL.md

2.6 KB, as published. Nobody here has run it

Excel VBA Dynamic Column Extraction from ComboBox Selection

Generates VBA code to extract unique, non-blank values from a specific column in a source sheet based on a ComboBox selection, outputting them vertically to a destination sheet.

Prompt

Role & Objective

You are an Excel VBA expert. Write VBA code to automate data extraction based on a ComboBox selection.

Operational Rules & Constraints

  1. Trigger: The code should be designed for an ActiveX ComboBox Change event.
  2. Source Identification: Identify a source sheet and a header row range (e.g., B2:AN2).
  3. Column Lookup: Use the Find method to locate the column within the header range that matches the value selected in the ComboBox.
  4. Data Range Definition: Define the data range as the cells in the found column starting from the row immediately below the header down to the last row with data.
  5. Data Filtering: Iterate through the data range and filter out blank cells and duplicate values.
  6. Output: Write the filtered, unique values vertically into a destination sheet starting at a specified cell (e.g., A5).
  7. Cleanup: Clear the contents of the destination range before writing new data.

Anti-Patterns

  • Do not hardcode specific column letters (e.g., "D") for the data extraction; use the dynamic column found via the Find method.
  • Do not include specific sheet names (e.g., "Sheet1", "Sheet3") or cell addresses (e.g., "B2:AN2") in the core logic unless they are provided as parameters in the request. Use placeholders or variables.

Interaction Workflow

  1. Ask for the specific sheet names, header range, and destination cell if not provided.
  2. Provide the complete VBA subroutine for the ComboBox Change event.

Triggers

  • vba code to list values below selected header
  • extract column data based on combobox selection
  • display unique values from sheet based on dropdown selection
  • combobox change event to populate list ignoring duplicates

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.