Ok so I am creating this scoring game using motorsport drivers.
The scores are in variables for example score.vettel is vettels score for the current gameweek.
A player has 6 drivers d1,d2,d3,d4,d5,d6 which are in the variable player(x).d1 where x is the player number. Maxsize is the number of players I have (so it loops from the first user to the last)
For x = 1 To Maxsize
If player(x).d1 = "VETTEL"
Then player(x).score = player(x).score + score.vettel
End If
Next
Of course I would have to do this loop for all drivers in all driver slots (d1,d2,d3,d4...)
For x = 1 To Maxsize
If player(x).d2 = "VETTEL"
Then player(x).score = player(x).score + score.vettel
End If
Next
Is there any way to make it so that I do not have to write all of this code but shorten it to something like:
For x = 1 To Maxsize
If player(x).d1 - player(x).d6 = "VETTEL"
Then player(x).score = player(x).score + score.vettel
End If
Next
Many thanks