Ok, so, in the code below, (from your erlier post), this can only affect the last cell that can be selected or "active" because it is in the Private Sub - "SelectionChange". Correct??
[vba] '//if reached the last entry in this row
If Left(Target.Address, 2) = LastCol Then
Application.EnableEvents = False
'
[/vba]
If so, can Private Sub Change be used directly to ;
[vba]Private Sub Worksheet_Change(ByVal Target As Range)
'
Dim Cell As Range
'
Const LastCol As String = "$M"
'**************************
'
If Target.Row.Count = 0.00 Then Exit Sub
'
If Changed = True And Target.Row = Range("B":"M" & Rows.Count).End(xlUp).Row Then
'
On Error Goto Finish
ActiveSheet.Unprotect password:=""
Application.EnableEvents = False
'
'//insert new row
Rows(Target.Row + 1).Insert Shift:=xlDown
'
'//copy row
Rows(Target.Row).Copy
'
'//paste formats in the new row
Rows(Target.Row + 1).PasteSpecial xlPasteFormats
Rows(Target.Row + 1).Borders(xlEdgeTop).LineStyle = xlNone
'
With Range("M" & Target.Row + 1).Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
End With
'
'//copy formulas to the new row
For Each Cell In Range("B" & Target.Row, "M" & Target.Row)
If Cell.HasFormula Then Cell.Offset(1, 0) = Cell.FormulaR1C1
Next
'
Range("B" & Target.Row + 1).Select
Changed = False
End If
'
End If
Finish:
Application.EnableEvents = True
ActiveSheet.Protect password:=""
End Sub [/vba]