Advertisement
Combreal

teamofthemonth.vbsq

Feb 15th, 2021
1,861
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub GreedyTeamOfTheMonth() 'GTOTM
  2.    Call GetLogs
  3.     Dim Team As String
  4.     Dim counter As Integer
  5.     Dim Teams(15, 2)
  6.    
  7.     counter = 0
  8.     For j = LBound(samLogs) To TotalRows - 1
  9.         If InStr(samLogs(1, j), "2021") Then
  10.             Team = samLogs(7, j)
  11.             If Not Team = "" Then
  12.                 For k = LBound(Teams) To UBound(Teams) - 1
  13.                     'If Teams(k, 0) = samLogs(7, j) Then
  14.                    If InStr(Teams(k, 0), samLogs(7, j)) Then
  15.                         'Teams(k, 0) = samLogs(7, j)
  16.                        'Teams(k, 1) = Teams(k, 1) + 1
  17.                        'Debug.Print "Special case  " & samLogs(7, j)
  18.                        Debug.Print "Repeat"
  19.                     Else
  20.                         If counter <= UBound(Teams) Then
  21.                             'Debug.Print "Dont Repeat"
  22.                            Teams(counter, 0) = samLogs(7, j)
  23.                             Teams(counter, 1) = 1
  24.                             counter = counter + 1
  25.                         End If
  26.                     End If
  27.                 Next k
  28.             End If
  29.         End If
  30.     Next j
  31.    
  32.     For l = LBound(Teams) To UBound(Teams) - 1
  33.        'Debug.Print Teams(l, 0) & "   " & Teams(l, 1)
  34.    Next l
  35.    
  36.     For m = LBound(samLogs) To UBound(samLogs) - 1
  37.        'Debug.Print samLogs(7, m)
  38.    Next m
  39.  
  40.    
  41. End Sub
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement