Inserting rows with formulae on existing data

Closed
Kardar - May 31, 2011 at 06:32 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - May 31, 2011 at 08:34 AM
Hello,

I wanted to know if a macro could help me deal with the following:
The data is something like this:
Column Field1 Field2 Field3 Fieldx
Row1 xxxx aaaa ccccc ddddd
Row2 xxxy aaab cccce ddddn
Rowx xxx1 aaa2 cccc3 dddd4

I need to add a row on top of every single row as a header (with a different color/fill) and each cell to pickup the value of its subsequent row, effectively the new row becomes the header and subsequent row becomes the data...

I have a sheet which runs into hundreds of rows and need to do similarly for several running tabs and files...

Kindly help.
Thanks

1 response

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
May 31, 2011 at 06:43 AM
The answer is yes a macro can help in that. But I am sure that is not exactly what you wanted to ask if a macro would help or not. Rather you are looking for a macro

Could you please upload a sample EXCEL file WITH sample data, macro, formula , conditional formatting etc on some shared site like http://docs.google.com, http://wikisend.com/ , http://www.editgrid.com etc
AND post back here the link to allow better understanding of how it is now and how you foresee. Based on the sample book, could you re-explain your problem too.


Note
: your data need not be to be real data but a good representative of how data looks like
0
Hi,

Uploaded an example worksheet with two tabs 'Data' having the original data and 'New Data' contains the desired output values & format.

Essentially, I should be able to select the number of rows within which I want to add a new row on top of every individual row copying the same data - thus the new row becomes kind of a header. Additionally, I would like to change the first number '3' to some other number like '1' or '4' which is the criterial for my other calculations for identifying the field rows...

https://spreadsheets.google.com/spreadsheet/ccc?key=0AgJKewd1lLsXdGllR3hucXh0U3B4SEJyWmFPRUM1WXc&hl=en_US&authkey=CMP4y6UO
0
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
May 31, 2011 at 08:34 AM
So essentially when the macro runs, follow happens
1. Asks for start row from where the copy should start from
2. Asks for the end row where the copy should end
3. Ask for the row identifier to be used during paste process
4. create a new sheet with same headers as in the source sheet, if not already there. In case there start pasting from the last row
5. paste the rows (each row twice)
6. Replace in the pasted row the level identifier as in step 3
0