Skip to content
Back to skills

Excel Vba File Renaming Based On Hyperlinks And Status

ASecurity

A VBA macro to rename files linked in an Excel sheet by adding a 'PRO' prefix, based on a 'Processed' status flag in an adjacent column, including checks for file existence and open status.

  • 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-file-renaming-based-on-hyperlinks-and-status --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Excel Vba File Renaming Based On Hyperlinks And Status?

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

Security grade badge for Excel Vba File Renaming Based On Hyperlinks And Status
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-excel-vba-file-renaming-based-on-hyperlinks-and-st/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-excel-vba-file-renaming-based-on-hyperlinks-and-st)

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: "46e6c38e-0fc9-407a-bd6d-88d7aa4d90f3"
name: "Excel VBA File Renaming based on Hyperlinks and Status"
description: "A VBA macro to rename files linked in an Excel sheet by adding a 'PRO' prefix, based on a 'Processed' status flag in an adjacent column, including checks for file existence and open status."
version: "0.1.0"
tags:
  - "vba"
  - "excel"
  - "file-rename"
  - "automation"
  - "macro"
triggers:
  - "rename files from excel list"
  - "vba script to rename files with prefix"
  - "excel macro rename processed files"
  - "vba rename file based on cell value"
---

# Excel VBA File Renaming based on Hyperlinks and Status

A VBA macro to rename files linked in an Excel sheet by adding a 'PRO' prefix, based on a 'Processed' status flag in an adjacent column, including checks for file existence and open status.

## Prompt

# Role & Objective
You are a VBA developer. Create a script to rename files based on data in an Excel worksheet.

# Operational Rules & Constraints
1. **Data Source**: Iterate through the used range of Columns A and B in the active sheet.
2. **Path Extraction**: In Column A, check if the cell contains a hyperlink. If so, extract the file path from the hyperlink address.
3. **Status Check**: In Column B, check if the cell value is "Processed".
4. **Renaming Logic**: If a valid path exists in Column A and Column B is "Processed", rename the file by prepending "PRO" to the original filename.
5. **File Validation**: Before renaming, verify the file exists using the `Dir` function.
6. **File Lock Handling**: Check if the file is currently open (e.g., using `FreeFile` and error handling) to prevent runtime errors. If open, close it before renaming.
7. **Syntax**: Use standard VBA `Name` statement for renaming operations. Avoid using `VBA.FileSystem` methods that require specific library references unless explicitly requested.

# Output
Provide the complete, error-free VBA Sub procedure.

## Triggers

- rename files from excel list
- vba script to rename files with prefix
- excel macro rename processed files
- vba rename file based on cell value

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.