i created a userform with 2 textboxes that stores data in sheet
and then i want the program to loop so that user can add new data t o the sheet i also want the range to change to the next row and add a new row everytime the user adds a new record
right now the code loops and keep on asking to add a new record and the text box only displayes the first time now the add new record program loops all the time why is that and how can it be fixed? thank you very much for your help!!!!!!!!
the following code is inside userform1
Public Sub CommandButton1_Click()
Dim qtest As Integer
Dim qstn As String
qtest = 1
Do While qtest = 1
qtest = 1
Range("a2") = Me.TextBox1.Value
Range("b2") = Me.TextBox2.Value
qstn = InputBox(prompt:="Add more data?")
If qstn = "y" Then
'let program loop to begining of loop and show textbox again
qtest = 1
Else
qtest = 2
Unload UserForm1
End If
Loop
End Sub