Does it all have to be done in one step? My personal preference for something like this is usually to use the Data->Import Data-> Import External data command. Work through the text import wizard (hopefully your text file is set up so that it will be easy to parse into columns). Then you can use filters and/or pivot tables to extract the desired data into other cells.
If you have to do it in one step, or your text file isn't easily parsed, then you may end up using VBA to do this.
Bookmarks