I have two lists, the first is a "main" list and the second is a "key" list.
The main list looks something like this, where each line is a separate cell, all contained on one column:
apples 23
apples 6
bananas 14
cake 5
ice cream vanilla
watrmelon store bought
apples 3
chicken 5
As you can see, each cell will contain 2 items - a food item and then an associated number or description. Also note that there might be not be the same amount of spaces after the first item, and that some of the first items include spaces (such as ice cream). Also note that some things may not be spelled 100% correctly (such as watermelon), so I need it to recognize pretty-close spellings.
The key list will look something like this, again each item in it's own cell:
apples
ice cream
chicken
I want Excel to look at the main list, and if it finds an item that's also on the key list, it will print that item in one cell, and then print it's corresponding value in the adjacent cell. So, for example, it would look at the main list, see "apples", see that apples appears on the key list, and then print apples in a new cell, and then in the adjacent cell print 23. Essentially I need Excel to look at a long list and "pull out" elements that correspond to a master list (key list).
At the same time, I also need to keep the same items together. So... in my example above, if Excel was matching the main list to the key list, it would print out into new cells apples, 23; apples, 6; ice cream, vanilla; apples, 3; chicken, 5. However, I want it to see that there are 2 apples grouped together, and have it move that third apples up next to the other 2 apples (essentially so that no items is on it's on).
So that is where I am at right now. I know most of the basic functions, but did not know where to start. I am very willing to do this in VBA if that is easier/more possible - I know a little, but need some help getting started. Thank you in advance to anyone who can help!
Bookmarks