Beginner1
09-21-2013, 05:42 PM
Hi Experts!
I need your help to write this simple macro. This macro performs two tasks: inserting new columns and perform arithmetic additions. I have 10x4 table. it contains names in the first column, and numbers in the next 10 columns.
0) my (10x4) table is started at column C of Sheet2 (two) of a Workbook. The first column contains people name. The next column (column D, which I call col1) and other following columns contain numbers. This table initially has 10 columns, I label them as col1, col2, col3, col10)
1) Please tell me how to write an excel macro that performs several tasks below:
2) first, inserts a blank column between col3 and col4, put a label "sum1" on the new column. (the first column of this table is started column C. it contains text data like a, b, c, d
2) then add numbers in first row of col1, col2, and col3, place the sum in the corresponding cell of the newly created column "sum1"
3) then continue to perform the addition for the next rows of col1, col2, and col3 , the table has only 4 rows.
4) now the table has 11 columns, similarly insert a blank column between col8 and col9, call it "sum2"
5) then sum of two numbers in the first row of col7 and col8, then go on to the next row .
6) similarly, insert a new column between col10 and col11, call it "sum3", then copy the content of col10 to this newly created column. The end!
7) all these tasks are started by a click on "Start" button, which is placed alone in the Sheet1 of this Workbook
I attached screen capture of the table for your reference.
Thank you much for your help!
I need your help to write this simple macro. This macro performs two tasks: inserting new columns and perform arithmetic additions. I have 10x4 table. it contains names in the first column, and numbers in the next 10 columns.
0) my (10x4) table is started at column C of Sheet2 (two) of a Workbook. The first column contains people name. The next column (column D, which I call col1) and other following columns contain numbers. This table initially has 10 columns, I label them as col1, col2, col3, col10)
1) Please tell me how to write an excel macro that performs several tasks below:
2) first, inserts a blank column between col3 and col4, put a label "sum1" on the new column. (the first column of this table is started column C. it contains text data like a, b, c, d
2) then add numbers in first row of col1, col2, and col3, place the sum in the corresponding cell of the newly created column "sum1"
3) then continue to perform the addition for the next rows of col1, col2, and col3 , the table has only 4 rows.
4) now the table has 11 columns, similarly insert a blank column between col8 and col9, call it "sum2"
5) then sum of two numbers in the first row of col7 and col8, then go on to the next row .
6) similarly, insert a new column between col10 and col11, call it "sum3", then copy the content of col10 to this newly created column. The end!
7) all these tasks are started by a click on "Start" button, which is placed alone in the Sheet1 of this Workbook
I attached screen capture of the table for your reference.
Thank you much for your help!