Microsoft Excel - Range Look up - Asked By Tom on 17-May-13 11:42 AM

I want to open a workbook and select a range. G3:I40 and then for the macro to look for a name in that range and select me the value in Column H next to that name, and copy it. Getting it into the workbook that i need it to go i can do, but i just need the macro to find, select and copy it.
Matthew Johnson replied to Tom on 17-May-13 11:34 AM
If the cell is a named range, you wouldn't even need to look at any specific range of cells. The named range will return it's own specific value.
Matthew Johnson replied to Tom on 17-May-13 11:35 AM
The other way to read that is do use a VLookup.
Harry Boughen replied to Tom on 18-May-13 11:10 PM
Hello Tom,
Is the name in columnG or in columnI or can it be either. I assume it can't be in columnH as that is the one that you are looking in.
I would envisage something like
For each cell in G3:G40
If cell.value = Value then
value for export = cell.offset(0,1).value
endif
next cell
Obviously you will need to code this properly defining variables, ranges etc and would need a similar search through columnI if necessary with an appropriate offset to get the data you want.
Regards
Harry