TedX
Board Regular
- Joined
- Apr 18, 2021
- Messages
- 122
- Office Version
- 365
- Platform
- Windows
For those who know me, I suffer from CFOL (Cronic Fear Of Loops), please don't tell me they are the easiest thing ever, because the mere mention of the word numbs me into submission.
So having confessed (again), can someone please show me a VBA code that will loop through a horse race and colour in the highest three-scoring horses.
To make it easier for you, I need to tell you how it all works. Firstly in the image below, you can see Race 2 which has 18 acceptances, with horses 6, 8,10, 13 & 14 scratched from the event, therefore they are simply hidden rows, but they are still there of course. So every race I do has a different number of starters (Horses) and there is a different number of races per day. In the example, I have manually coloured in, in Green & Yellow the top three horses that have registered a score. There are only 4 horses running in this event that have a score, some races have every horse with a score, and some races have zero horses with a score. So you can see, everything changes, the things that never change are the things in the columns, the Horse names are always in Column B, and the scores are always in Colum S and there is never ever, going to be a race meeting that would exceed 300 runners, in fact, the maximum is 12 races of 24 runners for a total of 288 runners and the odds of that happening is larger than the number of Hydrogen atoms in the Universe. (so any loop doesn't need to go beyond 300 rows).
That's it, if I'm not clear, please ask me to rephrase some part. I can tell you that colouring in, 6 race meetings per day with an average of around 14 runners, takes me a long time and if I had a macro that just did it, it would do it in a couple of seconds. Thanks, heaps in advance
So having confessed (again), can someone please show me a VBA code that will loop through a horse race and colour in the highest three-scoring horses.
To make it easier for you, I need to tell you how it all works. Firstly in the image below, you can see Race 2 which has 18 acceptances, with horses 6, 8,10, 13 & 14 scratched from the event, therefore they are simply hidden rows, but they are still there of course. So every race I do has a different number of starters (Horses) and there is a different number of races per day. In the example, I have manually coloured in, in Green & Yellow the top three horses that have registered a score. There are only 4 horses running in this event that have a score, some races have every horse with a score, and some races have zero horses with a score. So you can see, everything changes, the things that never change are the things in the columns, the Horse names are always in Column B, and the scores are always in Colum S and there is never ever, going to be a race meeting that would exceed 300 runners, in fact, the maximum is 12 races of 24 runners for a total of 288 runners and the odds of that happening is larger than the number of Hydrogen atoms in the Universe. (so any loop doesn't need to go beyond 300 rows).
That's it, if I'm not clear, please ask me to rephrase some part. I can tell you that colouring in, 6 race meetings per day with an average of around 14 runners, takes me a long time and if I had a macro that just did it, it would do it in a couple of seconds. Thanks, heaps in advance