Another code question

Please post any questions regarding the program here.

Moderator: 2020vision

Another code question

Postby Smokin Joe » Fri Jun 06, 2008 8:24 am

I am writing some code which attempts clears the bet reference UNLESS the bet is not fully matched.

My code is:
For a = 5 To 150
ws1.Range("T" & a).Value = Betref
If Right(Betref, 1) <> "P" Then
' Clear bet references
ws1.Range("T" & a & ":W" & a).ClearContents
End If
Next a

However, the Bet Reference is cleared every time, even if the bet is partially matched, ie "P" is the last character.

What am I doing wrong?

Cheers
SJ
Smokin Joe
 
Posts: 115
Joined: Sat May 31, 2008 6:25 am

Postby GaryRussell » Fri Jun 06, 2008 9:00 am

Isn't the assignment the wrong way round?

ws1.Range("T" & a).Value = Betref

Should be:-

Betref = ws1.Range("T" & a).Value
User avatar
GaryRussell
Site Admin
 
Posts: 9871
Joined: Fri Nov 18, 2005 8:09 pm
Location: Birmingham, UK

Postby Smokin Joe » Fri Jun 06, 2008 11:02 am

yep, thanks Gary.

It's frustrating to get the easy bit of the code wrogn :oops:
Smokin Joe
 
Posts: 115
Joined: Sat May 31, 2008 6:25 am


Return to Help

Who is online

Users browsing this forum: Google [Bot] and 51 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.