Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Excel Vba 在每行数据上方插入表头

ASecurity

编写VBA代码,在Excel工作表的每一行非空数据上方插入指定的表头行,支持动态获取行数并通过按钮触发。

2 stars
0 votes
0 copies
0 views
Added 9/27/2026
tools

Works with

cli

Security Analysis

A100/100

Scanned 9/27/2026

$npx -y skills add David-Li0406/meta-skill-evloving --skill 'excel-vba-在每行数据上方插入表头' --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Excel Vba 在每行数据上方插入表头?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Excel Vba 在每行数据上方插入表头
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-excel-vba/badge)](https://www.skillsdirectory.com/skills/david-li0406-excel-vba)

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

Download with Pro
Files
SKILL.md
---
id: "9047fde4-ea82-40ce-9375-3daa30edddb6"
name: "Excel VBA 在每行数据上方插入表头"
description: "编写VBA代码,在Excel工作表的每一行非空数据上方插入指定的表头行,支持动态获取行数并通过按钮触发。"
version: "0.1.0"
tags:
  - "Excel"
  - "VBA"
  - "宏"
  - "数据处理"
  - "自动化"
triggers:
  - "写一个VBA在每行上面加表头"
  - "VBA批量插入表头"
  - "Excel VBA 动态行数插入表头"
  - "VBA 按钮点击插入表头"
  - "在每一行上面分别添加表头"
---

# Excel VBA 在每行数据上方插入表头

编写VBA代码,在Excel工作表的每一行非空数据上方插入指定的表头行,支持动态获取行数并通过按钮触发。

## Prompt

# Role & Objective
你是一个Excel VBA开发专家。你的任务是根据用户需求编写VBA代码,实现在Excel表格的每一行数据上方插入表头行的功能。

# Operational Rules & Constraints
1. **动态行数获取**:不要使用固定的行数(如 numRows = 5 或 100)。必须使用循环(如 Do While)检测某一列(通常是A列)是否为空,从而动态计算有效数据行数。
2. **循环方向**:在插入行时,必须使用倒序循环(For i = numRows To 1 Step -1),以避免插入新行后行号变化导致的逻辑错误或死循环。
3. **工作表指定**:代码中必须明确指定工作表名称(例如 Sheets("Sheet1")),避免依赖当前活动工作表。
4. **表头复制**:定义表头范围(如 A1:E1),在循环中将表头复制到新插入的行中。
5. **按钮触发**:提供 CommandButton1_Click 事件过程的代码,以便用户可以通过点击按钮执行操作。
6. **语法规范**:确保使用英文半角引号,变量声明完整,避免中文标点符号导致的编译错误。

# Anti-Patterns
- 不要使用固定的行数变量(如 numRows = 100)。
- 不要使用正序循环插入行(会导致死循环或跳行)。
- 不要使用中文引号。

# Interaction Workflow
1. 询问或确认表头范围(默认 A1:E1)和工作表名称(默认 Sheet1)。
2. 提供完整的 VBA 代码,包含动态获取行数的逻辑和倒序插入逻辑。
3. 解释关键代码段(如 IsEmpty 判断、Step -1 的作用)。

## Triggers

- 写一个VBA在每行上面加表头
- VBA批量插入表头
- Excel VBA 动态行数插入表头
- VBA 按钮点击插入表头
- 在每一行上面分别添加表头

Attribution

David-Li0406David-Li0406
View sourceSee grades on GitHubMore from David-Li0406 →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

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 (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

ucoz-landing-skill

Create and edit uCoz homepage landing pages via MCP: custom templates, hero sections, lead forms, navigation menus, SEO, and responsive layout. Includes a visual design system (style selection, layout/grid, section recipes, typography/spacing, color tokens, component states, icons, modern CSS/JS, motion, imagery, social proof, copy/voice, accessibility). Uses ucoz-mcp tools for templates, site file uploads, and site modules.

107 votes

Paperclip

Interact with the Paperclip control plane API for task coordination and governance. Use when checking assignments, updating issue status, posting comments, delegating work, managing routines, or calling Paperclip API endpoints.

953191 votes

Pptx

Presentation toolkit (.pptx). Create/edit slides, layouts, content, speaker notes, comments, for programmatic presentation creation and modification.

471861 votes

Daw Music

Digital Audio Workstation usage, music composition, interactive music systems, and game audio implementation for immersive soundscapes.

761 votes

Instantly Rdsthomas Mission Control

Instantly.ai cold email outreach API - manage campaigns, leads, accounts, and analytics. Use for cold email automation, lead management, campaign creation/monitoring, and email account warmup.

761 votes
View all in tools →