|
J741 (TechnicalUser) |
24 Apr 12 1:29 |
O.K. I guess I didn't make myself clear. I know how to do this manually, but I don't know how to do this programatically in a macro. I think I need to make use of direct object references and array variables, but I'm not sure how. Part 1 of the problem (Which I don't have any idea how to do): ---------------------------------------------------------------
If I have a list of words (think like a 'word of the day') in worksheet "History" in C3:C42, and I have a list of many words (with many duplicates) to add to that in worksheet "ThisMonth" in H3:H47342, what macro code can I use to load all of the words located in History!C3:42 into an array variable, and then look through ThisMonth!H3:H47342 and identify only new words that do not already exist in the array and add it to the array, before dumping the array back out to History!C3:C(new number) ? Part 2 of the problem (for which my ideas did not work): --------------------------------------------------------
To complicate this even further, I need to figure out how to do this data range referencing indirectly, when the name of the worksheet containing the data (list of words), the column letter, the starting row number, and the ending row number all exist as values in separate cells in a worksheet named 'References' (because they can and do change). Example: CODE References!A4="ThisMonth" References!A5=3 References!A6=47342 References!A7=H so the new data resides in CODEIndirect(References!A4 & "!" & References!A7 & References!A5 & ":" & References!A7 & References!A6) But in a macro using CODERange(Indirect(References!A4 & "!" & References!A7 & References!A5 & ":" & References!A7 & References!A6).select or using CODERange(References!A4 & "!" & References!A7 & References!A5 & ":" & References!A7 & References!A6).select does not seem to work. If anyone can help me understand how to do this, programatically in a macro, it would be appreciated. My memory is not as good as it should be, and neither is my memory.
I have forgotten more than I can remember |
|