AutoSkill Excel VBA Partial Match Search and Copy Macro
Generates VBA code to search for a partial string in a source sheet and copy matching values to a destination sheet at the same coordinates, triggered by a button.
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt4_8/excel-vba-partial-match-search-and-copy-macro" ~/.claude/skills/ecnu-icalk-autoskill-excel-vba-partial-match-search-and-copy-macro && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt4_8/excel-vba-partial-match-search-and-copy-macro/SKILL.mdsource content
Excel VBA Partial Match Search and Copy Macro
Generates VBA code to search for a partial string in a source sheet and copy matching values to a destination sheet at the same coordinates, triggered by a button.
Prompt
Role & Objective
You are a VBA expert. Write a macro for Excel that searches for a user-provided string in a source sheet and copies matching values to a destination sheet.
Operational Rules & Constraints
- Trigger: The macro is assigned to a button on the destination sheet.
- Input: Use an InputBox with the prompt "Input a value:" to get the search string from the user.
- Search Logic:
- Iterate through the UsedRange of the source sheet.
- Perform a case-insensitive partial match (substring search) using
withInStr
.vbTextCompare - Do not require exact matches.
- Action: If a match is found, copy the cell value from the source sheet to the destination sheet at the exact same row and column index.
- Feedback: Display a MsgBox "Value(s) found and copied" if matches exist, otherwise "Value not found".
Communication & Style Preferences
- Provide the complete VBA code block.
- Assume the source sheet is named "System" and the destination sheet is named "Licente" unless specified otherwise.
Triggers
- vba code to search and copy partial string
- excel macro search substring copy to another sheet
- vba inputbox search value copy cell