VBA code for macro help

C

Cam

Hello,

I have two different data in two worksheets, worksheet 1 is the main data
that I would like to create a macro for. Sheet2 contains raw data that I pull
daily or weekly.

What I would like to achieve for the VBA macro is to dump the raw data in
sheet2 into sheet1, but put into the right cell. The macro needs to be able
to:
1) Fill in the s/o number to column D:G based on the latest operation number
for each model & part# type column.
2) Each model in the row will always have 2 (1300) & 2 (1500)
3) The row with "vendor" fill in do not require s/o fill in.
4) Column H:K, I can do a Vlookup to fill in the operation number from the
raw data.

Example: for row with No. 1002 & 1003 that have the same model, 218029
(1300) @ operation 100 is a later operation than 215789 (1300) @ operation
90, so the first s/o to fill in row with 1002 is 218031 and so on.

Here is the data sample:

Sheet1
No. ShipDate Model 1300 1300 1500 1500 Operation
Status
1001 17-Aug 100 vendor vendor vendor vendor #N/A #N/A #N/A #N/A
1002 18-Aug 200 218029 218031 215226 214526 100 95 320 197
1003 19-Aug 200 215789 218033 216999 216998 90 90 320
162
1004 19-Aug 100 215048 215780 215778 217693 90 90 410
180
1005 20-Aug 100 vendor vendor vendor vendor #N/A #N/A #N/A #N/A
1006 21-Aug 200 218035 216994 217000 218041 90 80 162
165
1007 25-Aug 100 216966 218975 218042 217001 80 70 300
150
1008 25-Aug 100 215765 215769 215779 215785 50 60 250
100

Sheet2
Raw Data
S/O Operation Ref Model
218029 100 1300 200
215789 90 1300 200
215048 90 1300 100
218035 90 1300 200
216966 80 1300 100
215765 50 1300 100
218974 20 1300 200
218031 95 1300 200
218033 90 1300 200
215780 90 1300 100
216994 80 1300 200
218975 180 1300 100
215769 320 1300 100
219680 150 1300 200
215226 320 1500 200
216999 320 1500 200
215778 410 1500 100
217000 162 1500 200
218042 150 1500 100
215779 250 1500 100
215790 110 1500 200
214526 197 1500 200
216998 162 1500 200
217693 180 1500 100
218041 165 1500 200
217001 150 1500 100
215785 10 1500 100
218039 110 1500 200

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top