As Skip has said above, it would be helpful to see some sample of your data. That said, here are some pointers:
Let's start with 2 open workbooks, say, "abc.xls" and "xyz.xls". I don't know why the
windows collection is appealing to you; I would use the
workbooks collection:
Code:
set wb1 = workbooks("abc.xls")
set wb2 = workbooks("xyz.xls")
Now let's say they both have only 1 worksheet each: abc.xls has a sheet named "zaphod", and xyz.xls has a sheet named "marvin":
Code:
set s1 = wb1.sheets("zaphod")
set s2 = wb2.sheets("marvin")
You can probably deduce that this could be done in one step:
Code:
set s1 = workbooks("abc.xls").sheets("zaphod)
set s2 = workbooks(xyz.xls").sheets("marvin")
Now, on sheet, s1, you have in row 1 a series of column headers, one of which is "Doc. Name/Description". So we can search row 1 in s1 for that and get the column index:
Code:
intCx = s1.rows(1).Find("Doc. Name/Description").column
Likewise, on sheet, s2, there's a column headed "Old Number", whose column index is:
Code:
intCy = s2.rows(1).Find("Old Number").column
Now here is where I'd need to see what the data look like in order to proceed. Let's just note that
s1.columns(intCx) is a (searchable) range, as is
s2.columns(intCy).
_________________
Bob Rashkin