LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Data logic/brain cramp

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007-macro programming logic for data validation Derek Megyesi Excel Discussion (Misc queries) 2 February 1st 10 01:34 AM
Data Validation using dependency logic maitri Excel Discussion (Misc queries) 1 November 12th 09 08:57 PM
Using COUNTIF for multiple text data creating a logic statment Scott Excel Worksheet Functions 12 January 16th 08 12:18 AM
USING DATA VALIDATION WITH CONDITIONAL LOGIC Data Validation AND Conditional Logic? Excel Discussion (Misc queries) 2 September 28th 07 05:09 PM
Logic to Determine if a Data Pivot Field Exist? ExcelMonkey[_103_] Excel Programming 0 March 4th 04 09:09 PM


All times are GMT +1. The time now is 08:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"