I have a spreadsheet with 4 columns of information, then a column for a primary name, and then many columns of secondary names (with a different number of secondary names for each row).
For rows with more than 1 secondary name, I need to create a new row with a copy of all the columns up to the secondary name for each secondary name in the row.
A row in the spreadsheet looks like this:
data data data data PrimaryName SecondaryName1 SecondaryName2 SecondaryName3... SecondaryNameN
I need this row to be replaced by the following set of rows:
data data data data PrimaryName SecondaryName1
data data data data PrimaryName SecondaryName2
data data data data PrimaryName SecondaryName3
...
data data data data PrimaryName SecondaryNameN
Here is some possible pseudo code for the algorithm:
int curRow = 1
IF (Cell(FcurRow)!=null)
{
* insert a duplicate of curRow below curRow
* delete all columns after E for curRow
* for the duplicated curRow (which is now curRow+1), shift over columns F through Z and make these columns E through Y
}
curRow++;
Bookmarks