Forums
Welcome to Live View – Take the tour to learn more
Start Tour
There is currently 1 person viewing this thread.
Steve Voltage
16 Sep 15 19:27
Joined:
Date Joined: 23 May 09
| Topic/replies: 6,499 | Blogger: Steve Voltage's blog
I'm struggling to write some excel vba code that will link to gruss/Betting Assistant. There forum is like tumbleweed so i am hoping someone on here can help pls Love

The code is :

Private Sub Worksheet_Change(ByVal Target As Range)
    If Range("S1").Value = "Yes" Then
        Range("Q2").Value = -1
   End If
End Sub

This code works fine when not connected to gruss.

If i connect my spreadsheet to gruss i think i need the following bits of code to added:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Columns.Count  16 Then Exit Sub
Application.EnableEvents = False

If Range("S1").Value = "Yes" Then
        Range("Q2").Value = -1
   End If
Application.EnableEvents = True
End Sub

However when i add the extra bits of code nothing happens, where am i going wrong please?
Pause Switch to Standard View Gruss Excel Vba Help Pls
Show More
Loading...
Report Steve Voltage September 16, 2015 7:46 PM BST
Ok ive tweaked this and come up with the following that seems to work but misses some races from the quick pick list!

Private Sub Worksheet_Change(ByVal Target As Range)
     If Target.Columns.Count = 16 Then
        Application.EnableEvents = False
If Range("S1").Value = "Yes" Then
        Range("Q2").Value = -1
        Else: Range("Q2").Value = 2
   End If
Application.EnableEvents = True
End If
End Sub


Any forumite know the answer please? Love
Report macarony September 16, 2015 8:20 PM BST
Forgive me for asking but what is it your trying to do is it auto load the quick pick list?
Report Steve Voltage September 16, 2015 8:45 PM BST
I'm trying to write some excel vba code for gruss/betting assistant so that the next race will be selected when all my bets are matched. So far i have come up with the following but some reason it jumps/misses races in the quick pick list.

When all my bets are matched "Yes" is entered in (T1). This the enters -1 into (Q2) loading the next race.
Report Smar Tarse September 16, 2015 9:00 PM BST
What do you do with the value 2 in "Q2" ?  Should it .Value = 0 for false ??
Report Steve Voltage September 16, 2015 9:21 PM BST
Smar Tarse 16 Sep 15 21:00 Joined: 01 Feb 07 | Topic/replies: 5,468 | Blogger: Smar Tarse's blog
What do you do with the value 2 in "Q2" ?  Should it .Value = 0 for false ??


value 2 controls the refresh rate of Betting Assistant after then -1 trigger has been entered into Q2.
Report macarony September 17, 2015 4:27 AM BST
I  tend to use the auto select markets function on the markets tab and then set it to the time I want the market to change usually between 1 and 5 minutes before the off, n
Report Steve Voltage September 17, 2015 7:50 AM BST
I'm fully aware of the manual way of doing things mate but I'm trying to automate things hence the need for the vba code.
Report Aunty Post September 17, 2015 8:45 AM BST
Ask Gary and Mark. They are the good guys in this business and don't treat it as a Monday to Friday, 9-5 business, unlike others I could name.

Gary wrote an entire programme for me, and said he didn't mind, as it was good practice for him.
How generous is that?
Report Shab September 17, 2015 3:37 PM BST
Don't know vba but I'm guessing your problem is that the quick pick list is dynamic (ie, as a race is run, that will disappear from the list).

If you have selected the race in position 3, then you want to go to 4 (which is the 'next' race) but a race has ended and removed from the list, the next race is actually in position 3.

Does is skip races only when there is racing on, and does it work OK when no racing is on?
Post Your Reply
<CTRL+Enter> to submit
Please login to post a reply.

Wonder

Instance ID: 13539
www.betfair.com