View Single Post
 
Old 04-26-2021, 12:31 PM
Steve Kunkel Steve Kunkel is offline Windows 10 Office 2019
Advanced Beginner
 
Join Date: May 2019
Location: Seattle area
Posts: 81
Steve Kunkel is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
A command to duplicate a line (which there isn't) would likely take as many or more keystrokes to implement as a simple copy/paste.
Not sure if I agree on the number of keystrokes... I tried to make a VBA macro to automate the keystrokes needed for duplicating a line and then commenting-out the top copy. Apparently VBA macros can't run inside the editor, so I made one with the awesome and opensource AutoHotkey Windows scripting language. Code is below.

WARNING -- NOT VBA CODE!
Code:
SetTitleMatchMode, 2 ; Win titles must contain specified string.

#ifWinActive, Microsoft Visual Basic for Applications 
!c:: ;Alt-c activates it, but only in VBA Editor
send {End}
send +{Home} ;shift+home
send ^c ;copy
send '^v ;apostrophe, paste
send {Enter}
send ^v ;paste
return
#ifWinActive
Reply With Quote