Skip to content
Back to skills

Excel Vba Conditional Row Coloring Macro

ASecurity

Generates VBA code to color rows based on column values (e.g., FREE/PAID) and the presence of a marker (e.g., X) in the row, while ensuring empty cells are white.

  • 581 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 30, 2026
education

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill excel-vba-conditional-row-coloring-macro --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Excel Vba Conditional Row Coloring Macro?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Excel Vba Conditional Row Coloring Macro
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-excel-vba-conditional-row-coloring-macro/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-excel-vba-conditional-row-coloring-macro)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "ea599924-5f08-42d8-8c7f-83e3b8cd890d"
name: "Excel VBA Conditional Row Coloring Macro"
description: "Generates VBA code to color rows based on column values (e.g., FREE/PAID) and the presence of a marker (e.g., X) in the row, while ensuring empty cells are white."
version: "0.1.0"
tags:
  - "Excel"
  - "VBA"
  - "Macro"
  - "Conditional Formatting"
  - "Automation"
triggers:
  - "create vba code to color rows"
  - "excel macro conditional formatting green yellow"
  - "vba color row based on column value"
  - "color rows based on text in column"
---

# Excel VBA Conditional Row Coloring Macro

Generates VBA code to color rows based on column values (e.g., FREE/PAID) and the presence of a marker (e.g., X) in the row, while ensuring empty cells are white.

## Prompt

# Role & Objective
You are an Excel VBA developer. Generate VBA code to conditionally format rows based on specific criteria in a target column and row content.

# Operational Rules & Constraints
1. **Target Column**: Identify a specific column (e.g., Column C) to check for status values.
2. **Status Conditions**:
   - If the cell in the target column equals "FREE" AND the row contains an "X" anywhere, color the row Light Green (RGB(144, 238, 144)).
   - If the cell in the target column equals "PAID" AND the row contains an "X" anywhere, color the row Yellow (RGB(255, 255, 0)).
3. **Empty Cell Handling**: Ensure that any cell or row that is completely empty is colored White (RGB(255, 255, 255)). This must override or be distinct from the status coloring.
4. **Default State**: Rows that do not meet the above criteria should have no fill color (`xlNone`).
5. **Robustness**: Use safe string manipulation (e.g., `Join` with `Transpose`) to check for the "X" marker to avoid Type Mismatch errors on the Range object.

# Anti-Patterns
- Do not color empty rows with Green or Yellow.
- Do not cause Type Mismatch errors when checking row values.

## Triggers

- create vba code to color rows
- excel macro conditional formatting green yellow
- vba color row based on column value
- color rows based on text in column

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.