All pastes #910763 Raw Edit

Excel

public text v1 · immutable
·published 2008-02-20 04:49 UTC
rendered paste body
Sub CALLAUDITSUMMARY()
     Dim rng As Range
     Dim rng2 As Range
     Dim celle As Range
     Dim staff As New Collection
     Dim count As Collection
     Dim i As Long
     Dim count As Integer
     
     Set rng = Range(Sheets("CALL AUDIT DATA").[B2], Sheets("CALL AUDIT DATA").[U200].End(xlUp))
     rng.Sort Key1:=Range("B2"), Order1:=xlAscending, Key2:=Range("U2") _
             , Order2:=xlAscending, Header:=xlNo, OrderCustom:=1, MatchCase:=False _
             , Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2:= _
             xlSortNormal
     
     Set rng = Range(Sheets("CALL AUDIT DATA").[B2], Sheets("CALL AUDIT DATA").[B200].End(xlUp))
     
     For Each celle In rng       'this is the part I don't understand...  
         On Error Resume Next    'it condenses a list of many names into just the unique ones.
         staff.Add celle, celle  'I was wanting to add a ticker to tally how many of each name
                                 'was found.
     Next celle
   


     Sheets("CALL AUDIT DATA").Cells(1, 27) = "COLLECTOR"
     Sheets("CALL AUDIT DATA").Cells(1, 27).Font.Bold = True
     
     For i = 1 To staff.count
         Sheets("CALL AUDIT DATA").Cells(i + 1, 27) = staff(i)
     Next i