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
x1Down
instead ofxlDown
.x1Down
is treated as a variable name, which not exists. Use Intellisense if you are not careful.