> ## Content Index
> Fetch the complete content index at: https://nolongerset.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# How to Duplicate a Line of Code in VBA
- URL: https://nolongerset.com/duplicate-one-line-of-vba/
- Published: 2023-01-19T03:10:15.000Z
- Updated: 2026-05-08T12:52:14.000Z
- Description: It's not quite a single shortcut key, but it's nearly as efficient.
- Author: Mike Wolfe
- Tags: Quick Tip, Hidden Features, #Import 2026-05-20 02:59

In yesterday's article, I lamented the arduousness inherent in duplicating lines of code in VBA.

To work around VBA's lack of a duplicate line shortcut key, [I use the following keystroke sequence](https://nolongerset.com/duplicating-vba-lines/#a-very-slightly-faster-way) instead:

1. \[Shift\]+\[Down\] to make my initial selection
2. \[Ctrl\]+\[C\] to copy the selection
3. \[Ctrl\]+\[V\] to move the cursor to the end of the selection
4. \[Ctrl\]+\[V\] to paste the selected text

As I wrote yesterday, I've used this technique over the years to save literally dozens of seconds writing code every single month.

## An Even Better Way

I ~~can't~~ can begin to express the joy I felt when I checked the comments on that article this morning, but I've not the time nor the vocabulary to express that joy in full.

**Lo**, [in the comments](https://nolongerset.com/duplicating-vba-lines/#commento-comment-card-8b71200ba96412a6284b65c8f28fc56c1c2b268b78fe0cb3312453c97b6a85c4), esteemed reader [Carsten Gromberg](https://c4u-software.de/) presented a *much* more efficient alternative than mine.

**Behold**, the *much* more efficient alternative:

> 1. \[Ctrl\] + \[Y\] -> deletes the complete line to the clipboard (the cursor can be anywhere in this line)
> 2. \[Ctrl\] + \[V\] -> restores the line
> 3. \[Ctrl\] + \[V\] -> inserts a copy of that line after the restored line

I will point out that this technique does not work to copy *multiple* lines of code at once, but for single-line code copying it puts my own efforts to shame.

Vielen Dank, Carsten! 

And [Richard Rost](https://nolongerset.com/duplicating-vba-lines/#commento-comment-card-4bf07a0fb819762a9492ef93ff3659cba4ad6e0f9a37c4a2e5851284ac495522), you'll need to stay up late if you want to beat those Europeans to the punch next time.