Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
help with loop
I need to process some data that looks like this:
02.01.01.01 PSE Staff 02.01.01.01 PSE Staff 02.01.01.01 PSE Staff 02.01.01.01 PSE Staff 02.03.01 Materials&Processes 02.03.01 Materials&Processes 02.03.02 Contamination Cntrl 02.03.02 Contamination Cntrl 02.07.02.01 Launch Sys Engrg 02.07.02.01 Launch Sys Engrg 02.08.01.01 Project Requirements 02.08.01.02 Project Requirements There are more columns to the right that I need to summarize. I need a loop (or maybe more than 1) to process each record and when value in col A (task number) changes: 1. sum numeric cols from start of current "A" to end 2. delete duplicate labels after 1st row of current "A" I'm sure this has been tackled before, so I hope someone can steer me in the right direction. So far I have this: Sub tester() iRepRow = 2 sThisTask = Cells(iRepRow, 1) sLastTask = sThisTask Do iThisTaskStartRow = iRepRow Do 'get next iRepRow = iRepRow + 1 sThisTask = Cells(iRepRow, 1) 'check for a new task If sThisTask < sLastTask Then 'process this task here Exit Do End If sLastTask = sThisTask Loop If iRepRow lMaxRow Then Exit Do End If Loop End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
help with loop
Use text to columns under the data menu to put your dat a in separate
columns. Then put in headers in the top row and create a Pivot Table (again under the data menu) -- Regards, Tom Ogilvy "sugargenius" wrote in message oups.com... I need to process some data that looks like this: 02.01.01.01 PSE Staff 02.01.01.01 PSE Staff 02.01.01.01 PSE Staff 02.01.01.01 PSE Staff 02.03.01 Materials&Processes 02.03.01 Materials&Processes 02.03.02 Contamination Cntrl 02.03.02 Contamination Cntrl 02.07.02.01 Launch Sys Engrg 02.07.02.01 Launch Sys Engrg 02.08.01.01 Project Requirements 02.08.01.02 Project Requirements There are more columns to the right that I need to summarize. I need a loop (or maybe more than 1) to process each record and when value in col A (task number) changes: 1. sum numeric cols from start of current "A" to end 2. delete duplicate labels after 1st row of current "A" I'm sure this has been tackled before, so I hope someone can steer me in the right direction. So far I have this: Sub tester() iRepRow = 2 sThisTask = Cells(iRepRow, 1) sLastTask = sThisTask Do iThisTaskStartRow = iRepRow Do 'get next iRepRow = iRepRow + 1 sThisTask = Cells(iRepRow, 1) 'check for a new task If sThisTask < sLastTask Then 'process this task here Exit Do End If sLastTask = sThisTask Loop If iRepRow lMaxRow Then Exit Do End If Loop End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find loop doesn't loop | Excel Discussion (Misc queries) | |||
Advancing outer Loop Based on criteria of inner loop | Excel Programming | |||
Loop Function unable to loop | Excel Programming | |||
Problem adding charts using Do-Loop Until loop | Excel Programming | |||
HELP!!!! Can't stop a loop (NOT an infinite loop) | Excel Programming |