In the attached example you find two worksheets. 1.being a report. 2. being an archival sheet. In Module 1 you will see a test code that loops through the "historical" sheet and finds all the contracts associated with the contract number entered into range Q9 of the "Historical" tab. Then fills the corresponding contracts into the table Q13:AA30. This code is working fine. I then have an if statement that fills the commodity and quantity into A10 and E11 on the reports tab. I would then need a additional if statements to step down the report to fill the remaining contracts.
In Module 2 I have been trying to get the code to bypass the historical table on tab 2 and all the corresponding if statements. What I am trying to do is get the first corresponding contract to fill into A10 and E11 then offset to A13 and E14 and enter the next contract. So on and so forth. this code works fine if I only have a single contract, but I very seldom have a single commodity attached to a contract.
In Userform3 I have a combobox1 that populates the contract numbers available in column B of the "Historical" tab (currently being populated in Q9 of the "historical" tab). What I am attempting to make work is when the commandbutton1 on userform3 is selected it finds that particular contract number and fills the report for me. I know how to get the code to read off combobox1. I have been trying to test the code in a module before I insert it into the commandbutton1.
I hope this long drawn out explanation outlines what I am trying to accomplish.
Any help would be greatly appreciated.
Regards,
rlh
Bookmarks