Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
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
Find loop doesn't loop JSnow Excel Discussion (Misc queries) 2 June 24th 09 08:28 PM
Advancing outer Loop Based on criteria of inner loop ExcelMonkey Excel Programming 1 August 15th 05 05:23 PM
Loop Function unable to loop Junior728 Excel Programming 1 July 28th 05 10:23 AM
Problem adding charts using Do-Loop Until loop Chris Bromley[_2_] Excel Programming 2 May 23rd 05 01:31 PM
HELP!!!! Can't stop a loop (NOT an infinite loop) TBA[_2_] Excel Programming 3 December 14th 03 03:33 PM


All times are GMT +1. The time now is 09:57 AM.

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

About Us

"It's about Microsoft Excel"