PDA

View Full Version : Import particular data from book1 to book2



joboykmathew
05-10-2016, 06:52 PM
Hello

I am quite new to VBA. I have two files: Book1 and Book2.
Book1 is imported monthly from the database with the profit and actual updated monthly.
Book2 is where the data for each month is updated monthly and totals are calculated.

I want to have a import button for each month on book2 that will collect the data from book1. Both the tables are similar for both the files but the order they are in are different.
For eg:

Book 1 table:
Profit Actual
000 $0
001 $20
002 $1000

Book 2 table:
Profit Actual
0035 -
002 -
000 -

I want book2 to identify the appropriate profit from book1 and add the actual from book1 to book2 in the right order. The profits from book2 which are not found on book1 must be left blank. The profit from book1 that are not found on book2 must be added to the bottom of the row of book2 as this could be a new profit used in a particular month only.

Does anyone how this work.

I only know simple import function using VBA but that wont work for this particular, which is why I need help. Thanks guys.

16154
16155