PDA

View Full Version : copy values with criteria



alienscript
11-12-2008, 10:25 AM
Hello VBA Excel experts,

The first table is actually gotten from Excel pivot table. Each time I had to manually copy down some cells in order for it to look like the result in the 2nd table. The iteration will be from row 2 to last row and then iterates from column 1 to last column. I hope to be able to get some help on how to do it in macro. I'm using Excel 2003. Thanks a lot.

(Sold-To) (SalesOrder) (SO_item)(ScheduleLine)(TotalOpenQty)
1182 1417866 000120 0001 41
0002 0
1417867 000030 0001 314
0002 0
000130 0001 314
000230 0001 314
1417870 000010 0001 113
0002 0
0003 0
1187C 1432972 000020 0001 15
1474160 000020 0001 16
1526367 000010 0001 205
1581557 000100 0001 60
5050 1217146 000170 0001 45
000270 0001 45
1355834 000140 0001 30
000240 0001 30
1355880 000100 0001 40
1355980 000100 0001 30
Grand Total 1612


(Sold-To) (SalesOrder) (SO_item) (ScheduleLine) (TotalOpenQty)
1182 1417866 000120 0001 41
1182 1417866 000120 0002 0
1182 1417867 000030 0001 314
1182 1417867 000030 0002 0
1182 1417867 000130 0001 314
1182 1417867 000230 0001 314
1182 1417870 000010 0001 113
1182 1417870 000010 0002 0
1182 1417870 000010 0003 0
1187C 1432972 000020 0001 15
1187C 1474160 000020 0001 16
1187C 1526367 000010 0001 205
1187C 1581557 000100 0001 60
5050 1217146 000170 0001 45
5050 1217146 000270 0001 45
5050 1355834 000140 0001 30
5050 1355834 000240 0001 30
5050 1355880 000100 0001 40
5050 1355980 000100 0001 30
Grand Total 1612