sthack99
Board Regular
- Joined
- May 16, 2006
- Messages
- 237
I have 2 databases. Both databases contain jobs and information pertained to the jobs. Each job is asigned a job number, and some job numbers contain mutliple lots number. Anyway, here's what I need:
In WB2 there's a column called "final dates". There is also a final dates column in WB1. I need a code that, when you open WB2, will automatically update the final dates for each job based on the info on WB1. Now, I know what you're thinking: "Why don't you just type a formula that says 'the contents of this cell in this WB is equal to the contents of the cell in the other WB'"? I wish it were that easy. Not every job and lot number in one book is in the other. So, the only thing I can think to do is construct a code that will look at the first job number in WB2, go to WB1, find that same job number (if it exists), do the same for the lot number (if one exists), grab the date, and insert it in WB2. Have I lost you yet? Here's how the columns look (in both WBs):
Job Number.......Lot Number.......Final Date
1000.................1......................6/25/2007
1000.................2......................5/28/2007
1000.................3
1025.................N/A..................12/12/2006
1032.................52
1032.................54....................1/2/2007
1033.................N/A...................3/20/2007
1041.................1
1041.................2......................4/21/2007
As you can see, there's not much consistancy, except the job numbers are in order. And also, as you can see, lot numbers can repeat. You just can't have the same lot number printed twice for the same job.
So what do you recommend I do about this?
In WB2 there's a column called "final dates". There is also a final dates column in WB1. I need a code that, when you open WB2, will automatically update the final dates for each job based on the info on WB1. Now, I know what you're thinking: "Why don't you just type a formula that says 'the contents of this cell in this WB is equal to the contents of the cell in the other WB'"? I wish it were that easy. Not every job and lot number in one book is in the other. So, the only thing I can think to do is construct a code that will look at the first job number in WB2, go to WB1, find that same job number (if it exists), do the same for the lot number (if one exists), grab the date, and insert it in WB2. Have I lost you yet? Here's how the columns look (in both WBs):
Job Number.......Lot Number.......Final Date
1000.................1......................6/25/2007
1000.................2......................5/28/2007
1000.................3
1025.................N/A..................12/12/2006
1032.................52
1032.................54....................1/2/2007
1033.................N/A...................3/20/2007
1041.................1
1041.................2......................4/21/2007
As you can see, there's not much consistancy, except the job numbers are in order. And also, as you can see, lot numbers can repeat. You just can't have the same lot number printed twice for the same job.
So what do you recommend I do about this?