YoungTurk
Mechanical
- Jul 16, 2004
- 333
HI,
I'm a VBA newbie trying to write some code for excel macros. I've gotten hung up on this one, though.
My goal is to sequentially work down an entire column of IDs in a workbook called DMOE.xls, match each ID to a column of IDs in a workbook called OCC.xls, and take the necessary related information from the OCC workbook matched ID row to the DMOE workbook. My first approach is to determine the length of the column of IDs and then run two nested FOR loops that many times to compare the values of each and every pair of IDs to find the matches. Unfortunately, I'm stumped for a way to determine the length of the column of IDs. Probably very simple, but Len and Count commands don't seem to be appropriate.
So, how can I count the number of rows with data in a given column? And, for extra credit, any ideas for a more efficient matching routine? (remember, between two different files).
Thanks in advance,
YoungTurk
I'm a VBA newbie trying to write some code for excel macros. I've gotten hung up on this one, though.
My goal is to sequentially work down an entire column of IDs in a workbook called DMOE.xls, match each ID to a column of IDs in a workbook called OCC.xls, and take the necessary related information from the OCC workbook matched ID row to the DMOE workbook. My first approach is to determine the length of the column of IDs and then run two nested FOR loops that many times to compare the values of each and every pair of IDs to find the matches. Unfortunately, I'm stumped for a way to determine the length of the column of IDs. Probably very simple, but Len and Count commands don't seem to be appropriate.
So, how can I count the number of rows with data in a given column? And, for extra credit, any ideas for a more efficient matching routine? (remember, between two different files).
Thanks in advance,
YoungTurk