Forums
There is currently 1 person viewing this thread.
Steve Voltage
16 Sep 15 19:27
Joined:
Date Joined: 23 May 09
| Topic/replies: 6,500 | 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?

Post your reply

Text Format: Table: Smilies:
Forum does not support HTML
Insert Photo
Cancel
sort by:
Show
per page
Replies: 9
By:
Steve Voltage
When: 16 Sep 15 19:46
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
By:
macarony
When: 16 Sep 15 20:20
Forgive me for asking but what is it your trying to do is it auto load the quick pick list?
By:
Steve Voltage
When: 16 Sep 15 20:45
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.
By:
Smar Tarse
When: 16 Sep 15 21:00
What do you do with the value 2 in "Q2" ?  Should it .Value = 0 for false ??
By:
Steve Voltage
When: 16 Sep 15 21:21
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.
By:
macarony
When: 17 Sep 15 04:27
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
By:
Steve Voltage
When: 17 Sep 15 07:50
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.
By:
Aunty Post
When: 17 Sep 15 08:45
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?
By:
Shab
When: 17 Sep 15 15:37
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?
sort by:
Show
per page

Post your reply

Text Format: Table: Smilies:
Forum does not support HTML
Insert Photo
Cancel
‹ back to topics
www.betfair.com