Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2006

Tip: Looking for answers? Try searching our database.

help with loop

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sugargenius - 22 Mar 2006 01:45 GMT
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
Tom Ogilvy - 22 Mar 2006 02:12 GMT
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)

Signature

Regards,
Tom Ogilvy

> I need to process some data that looks like this:
>
[quoted text clipped - 48 lines]
> Loop
> End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.