Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 shouldnt 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 Im 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 dont know how to reference the right rows because the end will fluctuate throughout. I cant 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 Im having a brain cramp just thinking about it. Help!! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2007-macro programming logic for data validation | Excel Discussion (Misc queries) | |||
Data Validation using dependency logic | Excel Discussion (Misc queries) | |||
Using COUNTIF for multiple text data creating a logic statment | Excel Worksheet Functions | |||
USING DATA VALIDATION WITH CONDITIONAL LOGIC | Excel Discussion (Misc queries) | |||
Logic to Determine if a Data Pivot Field Exist? | Excel Programming |