PDA

View Full Version : Solved: Uhh... Corresponding number detection and copying



realitybend
07-10-2008, 11:10 AM
I have one workbook with a sheet named "Sheet1", and another workbook with a sheet named "Sheet2" In "Sheet1" I have a list of numbers in column A, such as 4, 3, 5, 6, 8, 9, 11, 10, etc. In "Sheet2" of the other workbook, there are corresponding numbers, also in column A. These, however, aren't nessecarily in order. In "Sheet2" in column AB there are numbers that correspond to the numbers in column A, e.g. The number in A57 would correspond to AB57.

I need to copy the number in column AB of "Sheet2" (which corresponds to the number in the same row of column A on "Sheet2" and also corresponds to some row in column A of "Sheet1") and I need to paste it into "Sheet1" column B next to the corresponding number in column A.

If that made sense to you, you're a genius, and I need your help. If you see any way I can clarify, please tell me.

Help! :help

grichey
07-10-2008, 12:00 PM
Here's an example using just one workbook. This would be very easy to change to more than one workbook if the ranges are static.


:thumb

realitybend
07-10-2008, 12:40 PM
Thanks so much! However, there's one problem. The name of the workbook has a comma in it (like "Example, 103"), so it messes up VLOOKUP. :motz2: I can't change the file name.

I guess I need either a VBA solution, or something else that I don't know.

Thanks.

grichey
07-10-2008, 12:46 PM
the comman doesn't matter b/c your workbook name will be enclosed in ' 's like 'my,workbook'sheet2!$A$1:$AB$35 . I didn't think you could put punctuation other than like _ 's in a file name. News to me!

realitybend
07-10-2008, 12:54 PM
Thanks! One last question (I think). What's the column index number of BC (I thought it was AB, but I was wrong).

realitybend
07-10-2008, 01:00 PM
Never mind. I figured it out (55).

Thanks so much!

grichey
07-10-2008, 02:11 PM
Columindex for AB is 28 on an array A:AB