Hello again !
I am about to ask for help with something, and I think that it is probably fairly easy for someone with a bit of VBA knowledge....but I don't want to assume anything. I'm guessing that asking for complete code is kind of viewed as a bit lazy, but I'm hoping that I can learn from this, and be able to do it more myself in the future.
Here is what this macro needs to do:
The Setup: There are two workbook opened. Workbook#1 has the data listed in a table, and is updated every so often. Workbook#2 is where all the crunching is done at.... and so the data needs to be transferred from Workbook#1 to #2, each time it is opened, because new data will have been added to Workbook#1 while the workbooks were closed. There is a date and time stamp that is unique to each row of data...and by multiplying them together, it gives a unique ID# for each row of data(and that Unique ID is put into another column(c) next to the date and time columns(A and B) ).
So, using that lookup number I can manually do a vlookup for the last row of data in Workbook#2(where the prior days work had left off at),(from the first empty row below it(**actually I'm not sure if that's possible?) ) and thus copy over that next row of data from WB#1. To follow up transferring over the rest of the data, I assume it would be best to copy and paste it(or fill, or however it is said I this case) from WB#1 rather than use vlookup, ( in order to save resources(?).
In any event, the goal is to use a vba macro to do that work . ( the macro recorder would work for the copying part, but because of the vlookup, I'm not sure how to accomplish that with a recorder. ??? Thus, I come to here for advice on VBA code !
So, to recap... it needs to:
* locate the last row of data in WB#2 then...
* vlookup based on column C in WB#2 , and a separate table in WB#1(where the new data is). ( Im not sure how that would work because it has to look up the previous row, but vlookup returns the data from only the same row, right?)
* ....in this example code we can transfer over just one column, but in my code there will be several columns to transfer over.
* finally , copy /paste, (or set cells equal to), for the rest of the data from the table (in WB#1) to WB#2, w/each new row, until all the data is transferred.
*I suppose it could execute either by push button, or as soon as the workbook is open....although I think the former might be better, just in case there is a problem with opening both workbooks.
Well, there it is. Again , thank you for your time ! I really appreciate the boost to get me started in learning VBA better.
Bookmarks