Need Prev and Next codes for my Userform.Based on file only.

Discussion in 'Coding' started by cliffton jhed saldavia, Jul 14, 2017.

  1. cliffton jhed saldavia

    cliffton jhed saldavia

    Jul 14, 2017
    Likes Received:
    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
    cliffton jhed saldavia, Jul 14, 2017
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.