dizzydunham
New Member
- Joined
- Mar 22, 2014
- Messages
- 30
Just when I was starting to get a basic grasp for VBA!!
Little bit of code:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Row = [TotalVal1].Row - 1 Then
Application.EnableEvents = False
[TotalVal1].EntireRow.Insert
ActiveCell.Offset(-1, 0).EntireRow.Copy
ActiveCell.Offset(0, 0).EntireRow.PasteSpecial xlPasteFormats
Application.CutCopyMode = False
ActiveCell.Offset(0, 2).Select
Application.EnableEvents = True
End If
End Sub
All fine when enter button used to go down, but when I need to tab across to next column the line added is not the same format (Unmerges cells) also goes wrong if deleting lines afterwards from this point.
Any help appreciated as always.
Little bit of code:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Row = [TotalVal1].Row - 1 Then
Application.EnableEvents = False
[TotalVal1].EntireRow.Insert
ActiveCell.Offset(-1, 0).EntireRow.Copy
ActiveCell.Offset(0, 0).EntireRow.PasteSpecial xlPasteFormats
Application.CutCopyMode = False
ActiveCell.Offset(0, 2).Select
Application.EnableEvents = True
End If
End Sub
All fine when enter button used to go down, but when I need to tab across to next column the line added is not the same format (Unmerges cells) also goes wrong if deleting lines afterwards from this point.
Any help appreciated as always.