Get rid of your helper column and find last row of column B
Option Explicit
Dim LastRow As Integer
Private Sub cmdAdd_Click()
With Sheets("PartTKC3")
LastRow = Cells(.Rows.Count, "B").End(xlUp).Row
.Cells(LastRow + 1, 2).Value = Me.txtNama.Value
.Cells(LastRow + 1, 3).Value = Me.txtSesi.Value
.Cells(LastRow + 1, 4).Value = Me.txtTarikh.Value
.Cells(LastRow + 1, 5).Value = Me.txtBox1.Value
.Cells(LastRow + 1, 6).Value = Me.txtBox2.Value
.Cells(LastRow + 1, 7).Value = Me.txtBox3.Value
'clear the data
Me.txtNama.Value = ""
Me.txtSesi.Value = ""
Me.txtTarikh.Value = ""
Me.txtBox1.Value = ""
Me.txtBox2.Value = ""
Me.txtBox3.Value = ""
Me.txtNama.SetFocus
End With
End Sub
Bookmarks