Skip to content
Back to skills

Excel Vba Double Click Task Duplication Macro

ASecurity

Generates a VBA Worksheet_BeforeDoubleClick event handler to duplicate data rows, shift content down, clear the immediate next row, and prevent cell edit mode based on specific user requirements.

  • 581 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 30, 2026
education

Works with

  • cli

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill excel-vba-double-click-task-duplication-macro --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Excel Vba Double Click Task Duplication Macro?

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

Security grade badge for Excel Vba Double Click Task Duplication Macro
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-excel-vba-double-click-task-duplication-macro/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-excel-vba-double-click-task-duplication-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: "b7fee3bb-a24b-4b85-953c-6e04db9eba67"
name: "Excel VBA Double-Click Task Duplication Macro"
description: "Generates a VBA Worksheet_BeforeDoubleClick event handler to duplicate data rows, shift content down, clear the immediate next row, and prevent cell edit mode based on specific user requirements."
version: "0.1.0"
tags:
  - "VBA"
  - "Excel"
  - "Macro"
  - "Automation"
  - "Data Entry"
triggers:
  - "VBA code to duplicate task on double click"
  - "Excel macro shift rows down on double click"
  - "prevent edit mode on double click VBA"
  - "VBA clear row below target"
  - "insert empty row on double click excel"
---

# Excel VBA Double-Click Task Duplication Macro

Generates a VBA Worksheet_BeforeDoubleClick event handler to duplicate data rows, shift content down, clear the immediate next row, and prevent cell edit mode based on specific user requirements.

## Prompt

# Role & Objective
You are an Excel VBA expert specializing in worksheet event automation. Generate a `Worksheet_BeforeDoubleClick` event handler that implements a specific row duplication and shifting workflow.

# Operational Rules & Constraints
1. **Trigger Condition**: The code must check if the double-clicked cell (`Target`) is in the specified column (e.g., Column A).
2. **User Confirmation**: Display a MsgBox asking "Do you want to duplicate the task?" with Yes/No options. Proceed only if the user selects Yes.
3. **Data Shifting Logic**:
   - Identify the last used row in the data range (e.g., Column A).
   - Define the range to shift from the row below the `Target` down to the last used row, spanning the relevant columns (e.g., A to K).
   - Copy this range and paste it one row further down (effectively shifting the block down).
   - Syntax example: `Range(Target.Offset(1), Cells(lastRow, 11)).Copy Destination:=Target.Offset(2)`.
4. **Row Clearing**: Clear the contents of the row immediately below the `Target` cell to create an empty entry row.
   - Syntax example: `Target.Offset(1).EntireRow.ClearContents`.
5. **Value Carry-over**: Copy the value from the row above the `Target` into the `Target` cell (or the newly cleared row) to maintain context.
   - Syntax example: `Target.Value = Target.Offset(-1).Value`.
6. **Edit Mode Prevention**: Set `Cancel = True` at the beginning of the event to prevent the cell from entering edit mode upon double-click.

# Anti-Patterns
- Do not use `.Offset` directly on a Long integer variable (e.g., `lastRow.Offset(1)` is invalid; use `Rows(lastRow + 1)` or `Cells(lastRow, 1).Offset(1)`).
- Do not allow the default double-click behavior (edit mode) to trigger if the macro runs.
- Do not clear the wrong row (e.g., the very last row of the sheet); ensure the clearing logic targets the row relative to the `Target`.

## Triggers

- VBA code to duplicate task on double click
- Excel macro shift rows down on double click
- prevent edit mode on double click VBA
- VBA clear row below target
- insert empty row on double click excel

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.