Duso
09-05-2010, 02:31 PM
Hi everybody
The table at the Sheet ("PSk4") consists of 3 Column groups (B3:22; E3:G22; H3:J22; ... ) . Number of 3 Column groups is changing according to the value in D17 at Sheet 2. Max value is = 50. Number of rows is changing according to the value in D20 at Sheet2 – max number = 20.
Row 25 in the midle column of each of 3 Column groups includes any positive value (C25, F25, I25, ..).
In the same way as table above, is creating table at Sheet ("PSk5“) with different data.
What I need is: I would like
1) Macro1, that creates new table at Sheet ("P1Sk4") by copying and pasting the first 2 columns from 3 Column groups from table at the Sheet ("PSk4") . "2 Column groups" are B:C; E:F; H:I; ....Paste start to A1. Max number "2 Column groups" is = 12. Next "2 Column groups" if any are, are copying to the "empty + 1" row in column A - one row after previous part of new table.
The last row, where can be copy is row 44. Columns of table can´t be split by row 44. New table must start at row 45.
Old created table must be removed. Cells to which is not copying must be empty.
2)Macro2, that creates new 2 tables at Sheets ("P2Sk4") and ("P2Sk5") acording to the compared values that are include in rows 25 in the middle column of each of "3 Column groups" tables at Sheet ("PSk4") and Sheet ("PSk5") as follows. If value in row 25 matching columns at Sheet ("P1Sk4") >= value in row 25 at Sheet ("P1Sk5"), then adequate "2 Column groups" copy to Sheet ("PSk4"), else
copy to Sheet ("PSk5"). Copy and paste is the same as by Macro1.
MS Excel 2003.
Thanks in advance for the help
The table at the Sheet ("PSk4") consists of 3 Column groups (B3:22; E3:G22; H3:J22; ... ) . Number of 3 Column groups is changing according to the value in D17 at Sheet 2. Max value is = 50. Number of rows is changing according to the value in D20 at Sheet2 – max number = 20.
Row 25 in the midle column of each of 3 Column groups includes any positive value (C25, F25, I25, ..).
In the same way as table above, is creating table at Sheet ("PSk5“) with different data.
What I need is: I would like
1) Macro1, that creates new table at Sheet ("P1Sk4") by copying and pasting the first 2 columns from 3 Column groups from table at the Sheet ("PSk4") . "2 Column groups" are B:C; E:F; H:I; ....Paste start to A1. Max number "2 Column groups" is = 12. Next "2 Column groups" if any are, are copying to the "empty + 1" row in column A - one row after previous part of new table.
The last row, where can be copy is row 44. Columns of table can´t be split by row 44. New table must start at row 45.
Old created table must be removed. Cells to which is not copying must be empty.
2)Macro2, that creates new 2 tables at Sheets ("P2Sk4") and ("P2Sk5") acording to the compared values that are include in rows 25 in the middle column of each of "3 Column groups" tables at Sheet ("PSk4") and Sheet ("PSk5") as follows. If value in row 25 matching columns at Sheet ("P1Sk4") >= value in row 25 at Sheet ("P1Sk5"), then adequate "2 Column groups" copy to Sheet ("PSk4"), else
copy to Sheet ("PSk5"). Copy and paste is the same as by Macro1.
MS Excel 2003.
Thanks in advance for the help