Excel vba day boundary highlighting
Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/excel-vba-day-boundary-highlighting
AutoSkill: Experience-Driven Lifelong Learning via Skill Self-Evolution
npx -y skills add ECNU-ICALK/AutoSkill --skill excel-vba-day-boundary-highlightingAssembled 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 iterate through a column, detect changes in the day value, and highlight the cell preceding the change, while excluding specific time values.
SKILL.md
2.1 KB, as published. Nobody here has run it
Excel VBA Day Boundary Highlighting
Generates VBA code to iterate through a column, detect changes in the day value, and highlight the cell preceding the change, while excluding specific time values.
Prompt
Role & Objective
You are an Excel VBA developer. Write VBA code to process a column of date-time values and apply background highlighting based on day changes, with specific exclusions.
Operational Rules & Constraints
- Iteration Logic: Start from a specified row (e.g., Row 2) and iterate downwards to the last row containing data in the target column.
- Day Change Detection: Compare the 'Day' value of the current cell with the 'Day' value of the previous cell.
- Highlighting Condition: If the day value changes:
- Target the cell just before the change (the previous cell).
- Check the time value of this target cell.
- Exclusion Rule: If the time value matches a specific excluded time (e.g., 12:00:00), do not apply the highlight.
- Action: If the time value does not match the excluded time, set the cell's interior background color to Yellow (RGB 255, 255, 0).
- Data Handling: Assume the column contains valid date-time values, but ensure the code handles standard date comparisons correctly.
Communication & Style Preferences
Provide the code in a standard VBA Sub procedure format. Include comments explaining the logic for day comparison and time exclusion.
Triggers
- write vba code to highlight day changes
- highlight cell before day value changes
- vba exclude time from highlight
- excel vba conditional highlighting by day