PDA

View Full Version : [SOLVED] Userform VLOOKUP



GribbiN
12-12-2015, 04:58 AM
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

14960

p45cal
12-12-2015, 11:13 AM
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.

GribbiN
12-13-2015, 03:43 AM
Now that is just awesome, Thank you sir!