This is my first thread here.... so please if you can, don`t be harsh...
There is the thing, I am trying to build a UserForm just for "simple" search.
At the moment I have two worksheets - "Dati"; "kilas"
In both ws the lookup value is in col A.
What I did already,
User will put a Client ID number in search textbox called: "krednr"
Based on this criteria it retrives data to all other textboxes form different colums
It goes for ws "Dati" and "kilas"
This is what I have:
Private Sub CommandButton1_Click()
row_number = 0
Do
DoEvents
row_number = row_number + 1
item_in_review = Sheets("Dati").Range("A" & row_number)
If item_in_review = krednr.Text Then
TextBox1.Text = Sheets("Dati").Range("G" & row_number)
TextBox3.Text = Sheets("Dati").Range("H" & row_number)
TextBox4.Text = Sheets("Dati").Range("J" & row_number)
TextBox5.Text = Sheets("Dati").Range("F" & row_number)
TextBox6.Text = Sheets("Dati").Range("R" & row_number)
TextBox7.Text = Sheets("Dati").Range("M" & row_number)
TextBox8.Text = Sheets("Dati").Range("N" & row_number)
TextBox9.Text = Sheets("Dati").Range("AI" & row_number)
End If
Loop Until item_in_review = ""
row_number = 0
Do
DoEvents
row_number = row_number + 1
item_in_review = Sheets("kilas").Range("A" & row_number)
If item_in_review = krednr.Text Then
TextBox10.Text = Sheets("kilas").Range("D" & row_number)
End If
Loop Until item_in_review = ""
End Sub
But today I spent 4hours trying to find solution for cases when there is a multiple records for one client ID
I need them to show in one text box or listbox....
Example:
[TABLE="class: grid, width: 500"]
A
B
C
Client ID
Pet
Count
123
cat
1
177
dog
1
185
lion
1
123
dog
2
123
puma
1
[/TABLE]
Like for examp.:
If i insert Client ID "123"
It will show result
cat 1
dog 2
puma 1
And all in one "BOX"!
Where should i start?!