This code works to find the first 3 place winners and insert their winnings on my recap Sheets(“PAYOUTS”).
But, adding additional lines for Sheets(“2GROSS”) and (“3GROSS”) winners results in blank cells.
Can anyone explain or suggest a correction or better solution?
Code:
‘1st Flight Gross
If Sheets("1GROSS").[AB3] = "" Then
Sheets("PAYOUTS").[M3:M150] = ""
Else
temp = Application.Match(Sheets("1GROSS").[A3], Sheets("PAYOUTS").[B3].Resize(153), 0)
Sheets("PAYOUTS").[M3] = Application.Index(Sheets("1GROSS").[AB3].Resize(153), temp)
End If
If Sheets("1GROSS").[AB3] = "" Then
Sheets("PAYOUTS").[M3:M150] = ""
Else
temp = Application.Match(Sheets("1GROSS").[A4], Sheets("PAYOUTS").[B3].Resize(153), 0)
Sheets("PAYOUTS").[M4] = Application.Index(Sheets("1GROSS").[AB3].Resize(153), temp)
End If
If Sheets("1GROSS").[AB3] = "" Then
Sheets("PAYOUTS").[M3:M150] = ""
Else
temp = Application.Match(Sheets("1GROSS").[A5], Sheets("PAYOUTS").[B3].Resize(153), 0)
Sheets("PAYOUTS").[M5] = Application.Index(Sheets("1GROSS").[AB3].Resize(153), temp)
End If
But, adding additional lines for Sheets(“2GROSS”) and (“3GROSS”) winners results in blank cells.
Can anyone explain or suggest a correction or better solution?
Code:
'2nd Flight Gross
If Sheets("2GROSS").[AB3] = "" Then
Sheets("PAYOUTS").[N3:N150] = ""
Else
temp = Application.Match(Sheets("2GROSS").[A3], Sheets("PAYOUTS").[B3].Resize(153), 0)
Sheets("PAYOUTS").[N3] = Application.Index(Sheets("2GROSS").[AB3].Resize(153), temp)
End If
If Sheets("2GROSS").[AB3] = "" Then
Sheets("PAYOUTS").[N3:N150] = ""
Else
temp = Application.Match(Sheets("2GROSS").[A4], Sheets("PAYOUTS").[B3].Resize(153), 0)
Sheets("PAYOUTS").[N4] = Application.Index(Sheets("2GROSS").[AB3].Resize(153), temp)
End If
If Sheets("2GROSS").[AB3] = "" Then
Sheets("PAYOUTS").[N3:N150] = ""
Else
temp = Application.Match(Sheets("2GROSS").[A5], Sheets("PAYOUTS").[B3].Resize(153), 0)
Sheets("PAYOUTS").[N5] = Application.Index(Sheets("2GROSS").[AB3].Resize(153), temp)
End If
'3rd Flight Gross
If Sheets("3GROSS").[AB3] = "" Then
Sheets("PAYOUTS").[O3:O150] = ""
Else
temp = Application.Match(Sheets("3GROSS").[A3], Sheets("PAYOUTS").[B3].Resize(153), 0)
Sheets("PAYOUTS").[O3] = Application.Index(Sheets("3GROSS").[AB3].Resize(153), temp)
End If
If Sheets("3GROSS").[AB3] = "" Then
Sheets("PAYOUTS").[O3:O150] = ""
Else
temp = Application.Match(Sheets("3GROSS").[A4], Sheets("PAYOUTS").[B3].Resize(153), 0)
Sheets("PAYOUTS").[O4] = Application.Index(Sheets("3GROSS").[AB3].Resize(153), temp)
End If
If Sheets("3GROSS").[AB3] = "" Then
Sheets("PAYOUTS").[O3:O150] = ""
Else
temp = Application.Match(Sheets("3GROSS").[A5], Sheets("PAYOUTS").[B3].Resize(153), 0)
Sheets("PAYOUTS").[O5] = Application.Index(Sheets("3GROSS").[AB3].Resize(153), temp)
End If