Hello all,
First of all, I want to thank you guys, for this forum, and let you know that it helped me out quite a few times regarding VBA and macros. Since I am fairly new to VBA, and there are a lot of things I still need to learn, today I am stuck with issue. Straight to the topic:
I have an excel file that contains 2 sheets. Sheet1 called Data and Sheet 2 Called Form. On sheet2(Form) there is a Form that the User needs to fill in the required cells with information. I am trying to make this as automated as possible. I have a Userform in which he can manually input the datas. When a specific cell is filled in, I want excel too look for that value on the Data sheet, lookup its unique ID, and return all of the values with the same unique ID into the Form sheet.
Because of company policy i can't show the exact datas, so I created a similar one for reference.
My columns are from A to D, A being ID number, B name, C color and D box amount.
On the Form Sheet, the user input data is on cell D25, and the returned value starts from H25 downwards, depending how many unique ID's the item has.
If the User types in Baloon type 2, I need excel to check the ID number,and return all of the values from collumn C and D. Note that these rows are dynamic, it can have 5 rows with the same ID or 25 or even more.
[TABLE="border: 0, cellpadding: 0, cellspacing: 0, width: 260"]
[tr][td]ID
[/td][td]Name
[/td][td]Color
[/td][td]Box Amount
[/td][/tr][tr][td]1
[/td][td]Baloon type 2
[/td][td]red
[/td][td]5
[/td][/tr][tr][td]1
[/td][td][/td][td]green
[/td][td]10
[/td][/tr][tr][td]1
[/td][td][/td][td]blue
[/td][td]20
[/td][/tr][tr][td]1
[/td][td][/td][td]white
[/td][td]15
[/td][/tr][tr][td]1
[/td][td][/td][td]yellow
[/td][td]30
[/td][/tr][tr][td]1
[/td][td][/td][td]orange
[/td][td]8
[/td][/tr][tr][td]2
[/td][td]Ribbon type 4
[/td][td]black
[/td][td]5
[/td][/tr][tr][td]2
[/td][td][/td][td]yellow
[/td][td]10
[/td][/tr][tr][td]2
[/td][td][/td][td]red
[/td][td]15
[/td][/tr][tr][td]2
[/td][td][/td][td]white
[/td][td]8
[/td][/tr][tr][td]2
[/td][td][/td][td]purple
[/td][td]9
[/td][/tr][tr][td]2
[/td][td][/td][td]grey
[/td][td]12
[/td][/tr][tr][td]2
[/td][td][/td][td]orange
[/td][td]10
[/td][/tr][tr][td]2
[/td][td][/td][td]green
[/td][td]7
[/td][/tr]
[/TABLE]
I hope it is understandable, and thank you in advance!