PDA

View Full Version : Solved: retrieve specified field data from other Excel file & append to current Excel file.



beginner
06-13-2006, 12:30 AM
hello....

got a big query and need someone here to give a hand. thanks in advanced...!

1. got 2 Excel files, say file A and file B.
2. file A is the logbook (spreadsheet format) to keep accumulate records. while file B is an Excel file (form sheet format) which being updated everyday.

3. want to put a Macro inside file A (logbook) and after open file A & activate the macro, it will open file B and retrieve all specified fields data from file B and append to file A in pre-defined columns in file A.

Would anyone got suggestions hows those coding would look like....??

Thank you very much for any helping hands...

BR/
beginner

beginner
06-13-2006, 01:37 AM
hi.....

i got some coding from the this site and can achieve what i want.

but only still don't know how to do append action, ie. to check the current Workbook(logbook) the next blank record row, then can append the new data writing in...?? any suggestions to do the append action is appreciated. thanks a lot.

i am using below code to write the data (only show one row where dWB is another Workbook)

ThisWorkbook.Sheets(1).Cells(5, 2).Value = dWB.Sheets(1).Cells(1, 1).Value


BR/
beginner

lucas
06-13-2006, 07:01 AM
Killian talks about last used row in this thread:
http://www.vbaexpress.com/forum/showthread.php?t=8184

beginner
06-16-2006, 06:38 PM
hi Lucas, thanks for the info.

Beginner