Defined names are not necessary. Do not use select and selection. Make the layout so that it does not bother you when copying. To insert a row:
Sub VenA_add()
x = Application.Match("Total", Columns(2), 0)
Rows(x - 1).Copy
Rows(x - 1).Insert
Cells(x, 2).Resize(, 5) = Array("[Item]", "", 0, 0, "Update")
Application.CutCopyMode = False
End Sub
To delete the active row:
Sub VenA_delete()
x = Application.Match("Total", Columns(2), 0)
y = ActiveCell.Row
If y > 3 And x > 5 And y < x Then
Rows(y).Delete
Else
MsgBox "Unable to delete the item."
End If
End Sub
Bookmarks