A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Requires Macro (VBA code). To install the code below.
To install the Event VBA code:
- Right click the worksheet tab name
- Select "View code" (will open the VBA editor window at worksheet's module)
- Copy the VBA code below and paste into the VBA editor.
- Do NOT rename the sub
- Edit the code for insert above or below the data entry as per my instructions below.
- Close the VBA editor (Cross very top right of VBA editor window)
- Save the workbook as Macro enabled.
- Ensure macros are enabled. See help for how to do this. (Option to "Disable all macros with notification" should be OK.)
You have not indicated if the row is to be inserted above or below the data entry in column B. I have provided both options with one commented out (commented out will be green in VBA editor. You can remove the comment (single quote) from the beginning of the second line and comment out the other line if you want the inserted row above the data entry)
Private Sub Worksheet_Change(ByVal Target As Range)
'Test if change is in column B and only one cell changed
If Not Intersect(Target, Me.Columns("B")) Is Nothing And _
Target.Cells.Count = 1 Then
Target.Offset(1, 0).EntireRow.Insert Shift:=xlDown 'Insert row below data entry
'Target.EntireRow.Insert Shift:=xlDown 'Insert row above data entry
End If
End Sub