How can I create a macro that will take user input data and lookup that input in another workbook and return all columns and rows that are associated with the selection in your main worksheet?
For example, if the user prompts Nbr1 it should return all the columns for the rows containing Nbr1 in the below workbook.
For example, if the user prompts Nbr1 it should return all the columns for the rows containing Nbr1 in the below workbook.
Wong1.xlsx | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | |||
1 | id | days | duration | sex | age | piq | viq | |||
2 | Nbr1 | 3358 | 30 | 4 | Male | 20.67077 | 87 | 89 | ||
3 | Nbr1 | 3535 | 16 | 17 | Male | 55.28816 | 95 | 77 | ||
4 | Nbr1 | 3547 | 40 | 1 | Male | 55.91513 | 95 | 116 | ||
5 | Nbr1 | 3592 | 13 | 10 | Male | 61.66461 | 59 | 73 | ||
6 | Nbr1 | 3728 | 19 | 6 | Male | 30.12731 | 67 | 73 | ||
7 | Nbr1 | 3790 | 13 | 3 | Male | 57.06229 | 76 | 69 | ||
8 | Nbr1 | 3807 | 37 | 5 | Male | 24.67625 | 74 | 77 | ||
9 | Nbr1 | 3808 | 31 | 7 | Male | 28.26831 | 91 | 110 | ||
10 | Nbr1 | 4253 | 40 | 3 | Male | 22.6037 | 115 | 110 | ||
11 | 10 | 4356 | 31 | 7 | Male | 21.39904 | 86 | 83 | ||
12 | 11 | 4384 | 35 | 8 | Male | 36.38056 | 76 | 90 | ||
13 | 12 | 4542 | 22 | 11 | Female | 21.95756 | 71 | 89 | ||
14 | 13 | 4705 | 18 | 1 | Female | 21.68378 | 127 | 109 | ||
15 | 14 | 4744 | 15 | 25 | Male | 57.56605 | 82 | 85 | ||
16 | 15 | 4802 | 36 | 0 | Male | 62.47502 | 88 | 97 | ||
17 | 16 | 4941 | 46 | 4 | Female | 19.01437 | 69 | 88 | ||
18 | 17 | 4983 | 33 | 5 | Male | 38.39288 | 102 | 117 | ||
19 | 18 | 5129 | 26 | 1 | Male | 25.04586 | 77 | 89 | ||
Wong |