Does anyone else get a type mismatch error?
Code:
Sub sortMVP()
Dim uMVPcc As Double
uMVPcc = 2
With Worksheets("Overall")
.Activate
For j = 12 To 170 Step 4
Team = j / 4 - 2
For i = 3 To 62
If Worksheets(j).Visible And Val(Worksheets(j).Cells(i, 6)) > 0 Then
uMVPcc = uMVPcc + 1
.Cells(uMVPcc, 1) = Worksheets(j).Cells(i, 1)
.Cells(uMVPcc, 2) = Worksheets(j).Cells(i, 2)
.Cells(uMVPcc, 3) = "Tm " & Team
.Cells(uMVPcc, 4) = Worksheets(j).Cells(i, 3)
.Cells(uMVPcc, 5) = Worksheets(j).Cells(i, 4)
.Cells(uMVPcc, 6) = Worksheets(j).Cells(i, 5)
.Cells(uMVPcc, 7) = Worksheets(j).Cells(i, 6)
End If
Next i
Next j
.Range("A3:G1000").Sort Key1:=Range("G3"), Order1:=xlDescending, Header:=xlNo
End With
it occurs for me at the IF worksheets(j)... section.