Upon clicking run, I kept getting the runtime error 1004 and the codes in brackets below gets highlighted. Any one can help me with this
Private Sub Add_Click() Sheet4.Activate (Range("A1").End(x1Down).Offset(1, 0).Select) ActiveCell.Value = ActiveCell.Offset(-1, 0).Value + 1 ActiveCell.Offset(0, 1).Value = TextBox1.Value ActiveCell.Offset(0, 2).Value = TextBox2.Value ActiveCell.Offset(0, 3).Value = TextBox3.Value ActiveCell.Offset(0, 4).Value = ComboBox1.Value ActiveCell.Offset(0, 5).Value = ComboBox2.Value ActiveCell.Offset(0, 6).Value = TextBox4.Value
End Sub 1 1 Answer
To get rid from the error replace row 2, 3 & 4 with this:
Worksheets("Sheet4").Activate
Range("A1").End(xlDown).Offset(1, 0).Select
ActiveCell.Value = ActiveCell.Offset(-1, 0).ValueNote, End(x1Down) should written like End(xlDown), as also been suggested by @AKINA in comments above.