I would like to build an excel VBA program to find all the match values from a table and print the finding on a column… I tried to use vlookup but only gives me the first location that finds… and I would like all the finds.
here is an example:
my table starts on cell A2
- column A (number)
- 0084
- 0084
- 0085
- 0085
- 0086
-
0087
-
column B (location)
- 12AC5
- 16AC5
- 02AC5
- 06AC5
- 01DC5
- 11DC5
on column D I paste the values I am looking for there location….. on column F would give me all the location found that matches my request… in ascending order or any order
for example I am looking for the location of 2 numbers:
- column D (I paste the number that I what to see there location
- 0084
- 0087
I expect to see the results:
- column F(found location)
- 12ac5
- 12bd5
- 16ac5
Any help with this would be very much appreciated..
Cheers,
JFFC
excel VBA
enter code here
Clarification required. Are you:
Wanting to search for multiple values (in column A), return all the corresponding values(in column B) into column F?
An example of this is:
A, B, D, F
1,loc1,1,loc1
1,loc2,2,loc2
2,loc3, ,loc3
3,loc4, ,
3,loc5, ,
4,loc6, ,
Showing that if you serach for 1 and 2 (in column D) you get back Loc1, loc2 and loc3 because these are all the locations that match the numbers 1 and 2?
If this isnt what u are trying to do then i am confused
Macro to achieve this:
Paste that into your Excel VBA screen (Alt+F11) and run it (or link it to a button) Whenever you want to search click it
The results of this look like this:
Excel Example http://img97.imageshack.us/img97/9310/excelexample.jpg