xlf | FillHdlDblClk
Emulate the Fill Handle Double Click procedure
A VBA sub procedure to emulate the Excel fill handle double click (FillHdlBdlClk) procedure for a selection.
FillHdlDblClk - the VBA code
Code 1: Sub procedure
FillHdlDblClk emulate the Excel double click fill handle process
Sub FillHdlDblClk()
'' Macro shortcut: Ctrl + Shift + d
'' No error checking
Dim row1 As Long
Dim row2 As Long
Dim cols As Integer
With Selection
cols = .Columns.Count
row1 = .Row
row2 = .Offset(0, -1).End(xlDown).Row
.Copy
.Offset(0, 0).Resize(row2 - row1 + 1, cols).Select
End With
Selection.PasteSpecial _
Paste:=xlPasteFormulasAndNumberFormats
Application.CutCopyMode = False
End Sub
To use the code
- Copy and paste the code 1 procedure to a VBA module
- In Excel, open the
Macrodialog and select theFillHdlDblClkmacro - Then Click the
Optionsbutton to open theMacro Optionsdialog as shown in figure 1 - Add the shortcut key
Ctrl+Shift+D - Complete the Description panel
Fig 1: Macro options dialog - change the shortcut key and description - Click
OK
- This example was developed in Excel 2013 Pro 64 bit.
- Revised: Saturday 25th of February 2023 - 09:37 AM, [Australian Eastern Standard Time (EST)]
