Hi i want ti edit my data by using if and when i run the code it just go to first line and skip the others
Private Sub CommandButton1_Click()
Dim LastRow As Long
Dim NewRow As Long
LastRow = Sheet1.Cells(Rows.Count, 1).End(xlUp).Row
For NewRow = 3 To LastRow
If Sheet1.Cells(NewRow, 1) = CInt(Me.TextBox6) Then
Sheet1.Cells(NewRow, 2) = Me.TextBox1
Sheet1.Cells(NewRow, 3) = Me.TextBox2
End If
Next NewRow
End Sub
Private Sub CommandButton1_Click()
Dim LastRow As Long
Dim NewRow As Long
LastRow = Sheet1.Cells(Rows.Count, 1).End(xlUp).Row
For NewRow = 3 To LastRow
If Sheet1.Cells(NewRow, 1) = CInt(Me.TextBox6) Then
Sheet1.Cells(NewRow, 2) = Me.TextBox1
Sheet1.Cells(NewRow, 3) = Me.TextBox2
End If
Next NewRow
End Sub