
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) Step 3: In Declarations dropdown list, select BeforeDoubleClick.

Step 2: In current sheet window, select Worksheet in General dropdown list. Or you can enter Microsoft Visual Basic for Applications window via Developer->Visual Basic. Select View Code, Microsoft Visual Basic for Applications window pops up. Step 1: On current visible worksheet, right click on sheet name tab to load Sheet management menu. Method 2: Auto Fill Formula When Inserting New Rows/Data by VBA Code

Please be aware that this method is only effective when inserting a new row firstly, then copy/paste data or type your data manually into the new row. Step 6: Insert two new rows, then copy and past the other two rows of missing data in to column A & B, then range value will be auto calculated properly.
