I need to be able to insert rows in a sheet while maintaining the row number of the parent. In the example below, Line 3 is the parent and the 3 rows with "*" are the children. While this works, ideally I would like the 3 "*" to be replaced with the parent row number "3". This would be true no matter how many rows are added and the remainder of the row numbers would stay intact. In the example, row 4 is also a parent and the row under it with the "*" also represents a child - same need, i.e. the "*" would be replaced with the parent row number "4". In both cases, all the remaining numbered rows maintain their value. The code at the bottom is what is used to generate the child ("*") designations. Any suggestions would be appreciated. Thanks.
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
Target.Offset(1).EntireRow.Insert
Target.EntireRow.Copy Target.Offset(1).EntireRow
ActiveCell.Offset(1, 0).Select
ActiveCell.Value = "*"
Cancel = False
End Sub
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
Target.Offset(1).EntireRow.Insert
Target.EntireRow.Copy Target.Offset(1).EntireRow
ActiveCell.Offset(1, 0).Select
ActiveCell.Value = "*"
Cancel = False
End Sub