How BA updates the Excel sheet

Please post any questions regarding the program here.

Moderator: 2020vision

How BA updates the Excel sheet

Postby mellenec » Mon Feb 26, 2007 1:03 am

When, after a race (with 3 horses for example) has been selected, BA updates the Excel sheet, and you can see, while stepping through the Sheet change event that the 3 horses have been displayed in the sheet, but the last race horses( if > 3) are still there and will be deleted only after the event is left.

This seems strange to me...
How can I pick the correct number of horses (3 in this case) I need to copy with some other infos into another sheet?
mellenec
 
Posts: 94
Joined: Sun Jun 11, 2006 5:30 pm

Postby Mitch » Mon Feb 26, 2007 12:36 pm

The way I do it is to store the race name in a constant variable, then when A1 is not the same as the variable, clear all the cells.
User avatar
Mitch
 
Posts: 365
Joined: Sat Nov 19, 2005 12:28 am
Location: Leicester

Postby mellenec » Mon Feb 26, 2007 2:27 pm

Mitch wrote:The way I do it is to store the race name in a constant variable, then when A1 is not the same as the variable, clear all the cells.


Yes , I know how to do that ( I have the code in the Sheet Change event), but

- where do you put the code to do that ?
- how would you get the number of horses ? ( doing this in the Sheet Change event won't work, as I explained in another topic about how the Sheet is updated by BA)
mellenec
 
Posts: 94
Joined: Sun Jun 11, 2006 5:30 pm

Postby Mitch » Wed Feb 28, 2007 2:52 am

I have the code in the sheet change event if it's a small macro, or in a module called by the sheet change event if it's a big project.

I use the last row in col F minus 4 for the number of horses. It doesn't matter to me if there are non-runners. You could use COUNTA in your code if you only wanted to know how many horse names there were in col A.
User avatar
Mitch
 
Posts: 365
Joined: Sat Nov 19, 2005 12:28 am
Location: Leicester

Postby mellenec » Wed Feb 28, 2007 11:59 am

Mitch wrote:I have the code in the sheet change event if it's a small macro, or in a module called by the sheet change event if it's a big project.

I use the last row in col F minus 4 for the number of horses. It doesn't matter to me if there are non-runners. You could use COUNTA in your code if you only wanted to know how many horse names there were in col A.


Hi Mitch,
I finally fixed my problem:
If you do that without precaution, what you get the first time the sheet Change event is executed is the number of horses... of the last race, and until you leave this first Change Event subroutine, you may have some of the last race horses displayed (should they outnumber the current one's)!
It is only in the next Change events (assuming the race is the same one) that you get the right number and and with it you can delete the extra horses.

It's only after some debugging that I became aware of this.
mellenec
 
Posts: 94
Joined: Sun Jun 11, 2006 5:30 pm


Return to Help

Who is online

Users browsing this forum: Bing [Bot] and 108 guests

Sports betting software from Gruss Software


The strength of Gruss Software is that it’s been designed by one of you, a frustrated sports punter, and then developed by listening to dozens of like-minded enthusiasts.

Gruss is owned and run by brothers Gary and Mark Russell. Gary discovered Betfair in 2004 and soon realised that using bespoke software to place bets was much more efficient than merely placing them through the website.

Gary built his own software and then enhanced its features after trialling it through other Betfair users and reacting to their improvement ideas, something that still happens today.

He started making a small monthly charge so he could work on it full-time and then recruited Mark to help develop the products and Gruss Software was born.

We think it’s the best of its kind and so do a lot of our customers. But you can never stand still in this game and we’ll continue to improve the software if any more great ideas emerge.