J
JJwork
I have a worksheet that has names in one column and attributes in another and
a control # in a 3rd and other misc. data in others.
I need to be able to copy the misc. data into new rows for each name and
each attribute for each control #.
The data sort of looks like this.
Ctrl Name Attr Misc.
Z Harry gr/gr MiscZ
1 Joe bl/bl Misc1
1 Jane br/bl Misc1
1 Jim gr/br Misc1
2 Joe bl/gr Misc2
2 bl/br Misc2
3 Jane br/bl Misc3
3 Joe Misc3
3 Jim Misc3
4 Jill bl/bl Misc4
5 Jack gr/gr Misc5
It needs to end up like this
Ctrl Name Attr Misc.
Z Harry gr/gr MiscZ
1 Joe bl/bl Misc1
1 Joe br/bl Misc1
1 Joe gr/br Misc1
1 Jane br/bl Misc1
1 Jane bl/bl Misc1
1 Jane gr/br Misc1
1 Jim gr/br Misc1
1 Jim br/bl Misc1
1 Jim gr/br Misc1
2 Joe bl/gr Misc2
2 Joe bl/br Misc2
3 Jane br/bl Misc3
3 Joe br/bl Misc3
3 Jim br/bl Misc3
4 Jill bl/bl Misc4
5 Jack gr/gr Misc5
The code looks something like this (I do tons of other stuff in the loop
which shouldn’t mess this up)
For each row
if ctrl # = ctrl # - 1 row then
if name is blank then copy name – 1row
if attr is blank then copy attrib – 1row
end if
Next row
My problem comes in when I get multiple names AND multiple attributes. (see
ctrl #1 above). I need to add blank rows and then copy the information into
those rows. Since I’m using the row counter to point to the right cells, if
I add rows my count is off.
If I add them at the bottom I don’t know how to reference the right rows
because the ‘end’ will fluctuate throughout.
I can’t logically figure out how to point to the right cells and still be
able to run through all the data.
There probably is an easy way to do this but I’m having a brain cramp just
thinking about it.
Help!!
a control # in a 3rd and other misc. data in others.
I need to be able to copy the misc. data into new rows for each name and
each attribute for each control #.
The data sort of looks like this.
Ctrl Name Attr Misc.
Z Harry gr/gr MiscZ
1 Joe bl/bl Misc1
1 Jane br/bl Misc1
1 Jim gr/br Misc1
2 Joe bl/gr Misc2
2 bl/br Misc2
3 Jane br/bl Misc3
3 Joe Misc3
3 Jim Misc3
4 Jill bl/bl Misc4
5 Jack gr/gr Misc5
It needs to end up like this
Ctrl Name Attr Misc.
Z Harry gr/gr MiscZ
1 Joe bl/bl Misc1
1 Joe br/bl Misc1
1 Joe gr/br Misc1
1 Jane br/bl Misc1
1 Jane bl/bl Misc1
1 Jane gr/br Misc1
1 Jim gr/br Misc1
1 Jim br/bl Misc1
1 Jim gr/br Misc1
2 Joe bl/gr Misc2
2 Joe bl/br Misc2
3 Jane br/bl Misc3
3 Joe br/bl Misc3
3 Jim br/bl Misc3
4 Jill bl/bl Misc4
5 Jack gr/gr Misc5
The code looks something like this (I do tons of other stuff in the loop
which shouldn’t mess this up)
For each row
if ctrl # = ctrl # - 1 row then
if name is blank then copy name – 1row
if attr is blank then copy attrib – 1row
end if
Next row
My problem comes in when I get multiple names AND multiple attributes. (see
ctrl #1 above). I need to add blank rows and then copy the information into
those rows. Since I’m using the row counter to point to the right cells, if
I add rows my count is off.
If I add them at the bottom I don’t know how to reference the right rows
because the ‘end’ will fluctuate throughout.
I can’t logically figure out how to point to the right cells and still be
able to run through all the data.
There probably is an easy way to do this but I’m having a brain cramp just
thinking about it.
Help!!