Consulting

Results 1 to 3 of 3

Thread: Userform VLOOKUP

  1. #1
    VBAX Regular
    Joined
    May 2015
    Posts
    34
    Location

    Userform VLOOKUP

    Hello,
    I would really appreciate some hep and guidance, I have created a userform that i would like to use to look up some statistics. I have used vlookup in worksheets but never a userform so would like some help to get me started then i could potentially complete the rest.

    TextBox1 would be the look up value

    the remaining 14 textboxes would be for the returned values.
    All values are from the Count Summary sheet

    Thanks in advance

    PS Can you print userforms? If so can it ignore the grey to be more printer friendly

    Workbook is attached if needed

    John

    UserForm Help.xlsm

  2. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    Your code in the userform code manual could be:
    Private Sub TextBox1_Change()
    With Sheets("Count summary")
      rwno = Application.Match(TextBox1.Text, .Columns(2), 0)
      For i = 2 To 15
        If IsError(rwno) Then
          Controls("Textbox" & i).Text = "not found"
        Else
          Z = Choose(i, "A", "E", "F", "G", "H", "I", "J", "K", "L", "M", "P", "Q", "R", "S", "T")
          Controls("Textbox" & i).Text = .Cells(rwno, Z).Text
        End If
      Next i
    End With
    End Sub
    I've assumed you're looking up the store number.
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  3. #3
    VBAX Regular
    Joined
    May 2015
    Posts
    34
    Location
    Now that is just awesome, Thank you sir!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •