Previous and Next Buttons

rlink_23

Board Regular
Joined
Oct 30, 2015
Messages
149
So I am thoroughly stuck now. I am trying to set up my next and previous buttons, and I have tried multipe variations found online and nothing has worked. At all!!


The TextBox between the next and previous button is "TextBox9 and when the number is input in that it pops up all the info into the proper textBoxes on the userform. The coding I have to do this is rather long, but it functions. Hopefully someone will know how to help me.

Code for TextBox9
Code:
Private Sub TextBox9_Change()Dim I As Long, Lastrow As Long
Lastrow = Sheets("Quotes").Range("A" & Rows.Count).End(xlUp).Row
For I = 2 To Lastrow
If Sheets("Quotes").Cells(I, "A").Value = TextBox9 Or _
Sheets("Quotes").Cells(I, "A").Value = Val(TextBox9) Then
Dim Words() As String, LastColumn As Long
Dim Cars() As String, LastCell As Long
Dim custadd() As String, Smart As Long
Smart = Sheets("Quotes").Range("I" & Rows.Count).End(xlUp).Row
LastColumn = Sheets("Quotes").Range("I" & Rows.Count).End(xlUp).Row
LastCell = Sheets("Quotes").Range("I" & Rows.Count).End(xlUp).Row
Words = Split(Cells(I, "I").Value)
Cars = Split(Cells(I, "C").Value)
custadd = Split(Cells(I, "T").Value)
Me.quotenumber = Sheets("Quotes").Cells(I, "A").Value
Me.Date1 = Sheets("Quotes").Cells(I, "B").Value
On Error Resume Next
FirstName.Value = Words(0)
On Error Resume Next
LastName.Value = Words(1)
Year.Value = Cars(0)
Make.Value = Cars(1)
Model.Value = Cars(2)
If UBound(Cars) > 2 Then Model.Value = Cars(2) + " " + Cars(3)
shipfirst.Value = custadd(0)
shiplast.Value = custadd(1)




On Error Resume Next
Me.size = Sheets("Quotes").Cells(I, "D").Value
Me.ComboBox1 = Sheets("Quotes").Cells(I, "E").Value
Me.Cost = Sheets("Quotes").Cells(I, "F").Value
Me.custnumber = Sheets("Quotes").Cells(I, "G").Value
Me.company = Sheets("Quotes").Cells(I, "H").Value
Me.Phone1 = Sheets("Quotes").Cells(I, "J").Value
Me.City = Sheets("Quotes").Cells(I, "K").Value
Me.State = Sheets("Quotes").Cells(I, "L").Value
Me.ZipCode = Sheets("Quotes").Cells(I, "M").Value
Me.Email = Sheets("Quotes").Cells(I, "N").Value
Me.Initals = Sheets("Quotes").Cells(I, "P").Value
Me.TextBox7 = Sheets("Quotes").Cells(I, "Q").Value
Me.TextBox8 = Sheets("Quotes").Cells(I, "R").Value
Me.shipco = Sheets("Quotes").Cells(I, "S").Value
Me.shipadd1 = Sheets("Quotes").Cells(I, "U").Value
Me.shipadd2 = Sheets("Quotes").Cells(I, "V").Value
Me.shipcity = Sheets("Quotes").Cells(I, "W").Value
Me.shipstate = Sheets("Quotes").Cells(I, "X").Value
Me.shipzip = Sheets("Quotes").Cells(I, "Y").Value
Me.shipphone = Sheets("Quotes").Cells(I, "Z").Value
Me.shipemail1 = Sheets("Quotes").Cells(I, "AA").Value
Me.TAW = Sheets("Quotes").Cells(I, "AB").Value
End If
Next




CommandButton6.Enabled = False


 






End Sub

The locked command buttons is the save Function so someone can't save over the previous quote. Please please plesae help!!! :)
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Forum statistics

Threads
1,224,820
Messages
6,181,157
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top