- Joined
- Jul 14, 2017
- Messages
- 1
- Reaction score
- 0
I have an .xlsm file.I need only the Prev and Next button.You can create a button for the next and prev but based on the file only.
2 examples are enough.
This is the cod that i've been using to pull up the Employees Info
Private Sub TextBox1_Change()
Find = Val(Me.TextBox1.Value)
c = Application.WorksheetFunction.CountIf(Sheet1.Range("B:B"), Find)
If c = 0 Then
EMPNO.Text = ""
QIDNO.Text = ""
LNAME.Text = ""
Exit Sub
End If
On Error Resume Next
r = Application.WorksheetFunction.Match(Find, Sheet1.Range("B:B"), 0)
Me.EMPNO.Value = Sheet1.Range("B" & r).Value
Me.QIDNO.Value = Sheet1.Range("C" & r).Value
Me.LNAME.Value = Sheet1.Range("D" & r).Value
End Sub
2 examples are enough.
This is the cod that i've been using to pull up the Employees Info
Private Sub TextBox1_Change()
Find = Val(Me.TextBox1.Value)
c = Application.WorksheetFunction.CountIf(Sheet1.Range("B:B"), Find)
If c = 0 Then
EMPNO.Text = ""
QIDNO.Text = ""
LNAME.Text = ""
Exit Sub
End If
On Error Resume Next
r = Application.WorksheetFunction.Match(Find, Sheet1.Range("B:B"), 0)
Me.EMPNO.Value = Sheet1.Range("B" & r).Value
Me.QIDNO.Value = Sheet1.Range("C" & r).Value
Me.LNAME.Value = Sheet1.Range("D" & r).Value
End Sub