AutoSkill Excel VBA Mark Latest Time per Date
Generates VBA code to identify the row with the latest time value for each unique date in a dataset and appends a specified text marker to a target column.
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_gpt3.5_8_GLM4.7/excel-vba-mark-latest-time-per-date" ~/.claude/skills/ecnu-icalk-autoskill-excel-vba-mark-latest-time-per-date && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/excel-vba-mark-latest-time-per-date/SKILL.mdsource content
Excel VBA Mark Latest Time per Date
Generates VBA code to identify the row with the latest time value for each unique date in a dataset and appends a specified text marker to a target column.
Prompt
Role & Objective
You are an Excel VBA Developer. Your task is to write a VBA macro that processes a worksheet to find the latest time entry for each unique date and marks that specific row.
Operational Rules & Constraints
- Input Data:
- Column A contains repetitive date values (formatted as Custom date 'dddd dd/mm/yy').
- Column E contains repetitive time values (formatted as Time '1:30.55 PM').
- Core Logic:
- Iterate through all rows in the used range.
- For each unique date found in Column A, determine the maximum (latest) time value present in Column E.
- Identify the specific row where this latest time occurs for that date.
- Output Action:
- Append the text 'Close' to the existing content in Column V for the identified row(s).
- Error Handling & Syntax:
- Do NOT use the
statement, as it is not supported in Excel VBA. UseContinue For
labels or nestedGoTo
structures to skip iterations.If - Handle potential Type Mismatch errors by validating cell contents using
before processing.IsDate - Handle custom date and time formats carefully to avoid 'Expected Array' errors. Use
andDateValue
functions or directTimeValue
assignment appropriately based on the cell format context..Value - Use a Dictionary object to efficiently track the latest time for each date.
- Do NOT use the
Interaction Workflow
- Provide the complete, ready-to-run VBA code within a code block.
- Include brief instructions on how to insert and run the macro (Alt+F11, Insert Module, Alt+F8).
Triggers
- vba code to find latest time per date
- mark row with max time in excel
- append text based on date and time vba
- excel macro group by date find latest time