Help with Garry's example Multiple Trigger code

Discuss anything related to using the program (eg. triggered betting tactics)

Moderator: 2020vision

Help with Garry's example Multiple Trigger code

Postby Toma » Fri Jun 22, 2018 11:06 pm

Guys,

I stumbled across an excel spreadhseet that Garry wrote some time ago (viewtopic.php?f=8&t=6291) and it does exactly what I have been looking for. However, to trigger the bets I have to enter a 1 in col Y and while this is fine, does anyone know how I can amend the code to perform the multiple triggers (in the second sheet) when I load the race from the Quick Pick list?

I.e. I don't want to have to enter 1 in Col Y for every runner, every time I load a race I want to automate it?

Any help very much appreciated.

Cheers
Toma
 
Posts: 74
Joined: Sat Nov 19, 2005 9:06 pm
Location: Wallsend, Newcastle upon Tyne

Re: Help with Garry's example Multiple Trigger code

Postby alrodopial » Sat Jun 23, 2018 10:20 am

Hi, replace the code in sheet1 with the below code
I didn't check it so be careful
It will place your triggers in ***EVERY*** runner of the displayed market when the market changes
is this what you want?

Code: Select all
Dim storedRace As String

Private Sub Worksheet_Change(ByVal Target As Range)
    Dim r As Integer, triggerRow As Integer
    If Target.Columns.Count = 16 Then
        If Target(1, 1) = "" Then Exit Sub
        If Target(1, 1) <> storedRace Then
            Application.EnableEvents = False
            With ThisWorkbook.Worksheets("Triggers")
                For r = 5 To 54
                    'If Cells(r, 25) <> "" Then
                        triggerRow = Cells(r, 25) + 1
                        .Range(.Cells(triggerRow, 1), .Cells(triggerRow, 3)).Copy Range(Cells(r, 17), Cells(r, 19))
                        If Cells(r, 17) = "CANCEL-ALL" Then Cells(r, 20) = "ALL" Else Cells(r, 20) = ""
                        If Cells(r, 17) = "" Then Cells(r, 25) = "" Else Cells(r, 25) = triggerRow
                    'End If
                Next
            End With
            storedRace = Target(1, 1)
        End If
        Application.EnableEvents = True
    End If
End Sub
alrodopial
 
Posts: 1353
Joined: Wed Dec 06, 2006 9:59 pm

Re: Help with Garry's example Multiple Trigger code

Postby Toma » Sat Jun 23, 2018 2:04 pm

Thanks so much - this is exactly what I want , I will trial it this afternoon and let you know

Very much appreciated
Toma
 
Posts: 74
Joined: Sat Nov 19, 2005 9:06 pm
Location: Wallsend, Newcastle upon Tyne

Re: Help with Garry's example Multiple Trigger code

Postby Toma » Sat Jun 23, 2018 2:15 pm

So close mate, when it loaded the race it put the 1's in col "Y"

But it just said "trigger" "Odds" "price" (see attached)
Attachments
trigger.jpg
trigger.jpg (192.62 KiB) Viewed 21341 times
Toma
 
Posts: 74
Joined: Sat Nov 19, 2005 9:06 pm
Location: Wallsend, Newcastle upon Tyne

Re: Help with Garry's example Multiple Trigger code

Postby alrodopial » Sat Jun 23, 2018 4:44 pm

the bellow should be ok
headers in sheet "Triggers" must not be cleared

Code: Select all
Dim storedRace As String
Dim maxTriggersInRow As Integer
Dim triggerRow As Integer

Private Sub Worksheet_Change(ByVal Target As Range)
    Dim r As Integer
    If Target.Columns.Count = 16 Then
        If Target(1, 1) = "" Then Exit Sub
        If Target(1, 1) <> storedRace Then
            Range("Q5:U54").ClearContents
            maxTriggersInRow = ThisWorkbook.Worksheets("Triggers").Range("A" & Rows.Count).End(xlUp).Row
            If maxTriggersInRow <= 1 Then Exit Sub
            triggerRow = 1
            storedRace = Target(1, 1)
        End If
        If triggerRow <= maxTriggersInRow - 1 Then
            triggerRow = triggerRow + 1
            Application.EnableEvents = False
            With ThisWorkbook.Worksheets("Triggers")
                For r = 5 To 54
                    If Cells(r, 1) = "" Then Exit For
                    .Range(.Cells(triggerRow, 1), .Cells(triggerRow, 3)).Copy Range(Cells(r, 17), Cells(r, 19))
                    If Cells(r, 17) = "CANCEL-ALL" Then Cells(r, 20) = "ALL" Else Cells(r, 20) = ""
                Next r
            End With
            Application.EnableEvents = True
        End If
    End If
End Sub
alrodopial
 
Posts: 1353
Joined: Wed Dec 06, 2006 9:59 pm

Re: Help with Garry's example Multiple Trigger code

Postby Toma » Sat Jun 23, 2018 6:44 pm

That is brilliant mate, worked perfectly.

I will run it for the rest of racing tonight and let you know how it gets on.

Very much appreciated

Alan
Toma
 
Posts: 74
Joined: Sat Nov 19, 2005 9:06 pm
Location: Wallsend, Newcastle upon Tyne

Re: Help with Garry's example Multiple Trigger code

Postby Toma » Sun Jun 24, 2018 7:06 am

Thank you so much alrodopial this works perfectly, very much appreciated.

Cheers
Toma
 
Posts: 74
Joined: Sat Nov 19, 2005 9:06 pm
Location: Wallsend, Newcastle upon Tyne

Re: Help with Garry's example Multiple Trigger code

Postby vulturesquad » Thu Dec 31, 2020 4:45 pm

alrodopial wrote:the bellow should be ok
headers in sheet "Triggers" must not be cleared

Code: Select all
Dim storedRace As String
Dim maxTriggersInRow As Integer
Dim triggerRow As Integer

Private Sub Worksheet_Change(ByVal Target As Range)
    Dim r As Integer
    If Target.Columns.Count = 16 Then
        If Target(1, 1) = "" Then Exit Sub
        If Target(1, 1) <> storedRace Then
            Range("Q5:U54").ClearContents
            maxTriggersInRow = ThisWorkbook.Worksheets("Triggers").Range("A" & Rows.Count).End(xlUp).Row
            If maxTriggersInRow <= 1 Then Exit Sub
            triggerRow = 1
            storedRace = Target(1, 1)
        End If
        If triggerRow <= maxTriggersInRow - 1 Then
            triggerRow = triggerRow + 1
            Application.EnableEvents = False
            With ThisWorkbook.Worksheets("Triggers")
                For r = 5 To 54
                    If Cells(r, 1) = "" Then Exit For
                    .Range(.Cells(triggerRow, 1), .Cells(triggerRow, 3)).Copy Range(Cells(r, 17), Cells(r, 19))
                    If Cells(r, 17) = "CANCEL-ALL" Then Cells(r, 20) = "ALL" Else Cells(r, 20) = ""
                Next r
            End With
            Application.EnableEvents = True
        End If
    End If
End Sub
vulturesquad
 
Posts: 10
Joined: Fri Mar 20, 2020 3:41 pm

Re: Help with Garry's example Multiple Trigger code

Postby vulturesquad » Thu Dec 31, 2020 4:48 pm

alrodopial wrote:the bellow should be ok
headers in sheet "Triggers" must not be cleared

Code: Select all
Dim storedRace As String
Dim maxTriggersInRow As Integer
Dim triggerRow As Integer

Private Sub Worksheet_Change(ByVal Target As Range)
    Dim r As Integer
    If Target.Columns.Count = 16 Then
        If Target(1, 1) = "" Then Exit Sub
        If Target(1, 1) <> storedRace Then
            Range("Q5:U54").ClearContents
            maxTriggersInRow = ThisWorkbook.Worksheets("Triggers").Range("A" & Rows.Count).End(xlUp).Row
            If maxTriggersInRow <= 1 Then Exit Sub
            triggerRow = 1
            storedRace = Target(1, 1)
        End If
        If triggerRow <= maxTriggersInRow - 1 Then
            triggerRow = triggerRow + 1
            Application.EnableEvents = False
            With ThisWorkbook.Worksheets("Triggers")
                For r = 5 To 54
                    If Cells(r, 1) = "" Then Exit For
                    .Range(.Cells(triggerRow, 1), .Cells(triggerRow, 3)).Copy Range(Cells(r, 17), Cells(r, 19))
                    If Cells(r, 17) = "CANCEL-ALL" Then Cells(r, 20) = "ALL" Else Cells(r, 20) = ""
                Next r
            End With
            Application.EnableEvents = True
        End If
    End If
End Sub





just stumbled accross this great work. i have 1 query tho for me when i run it as i have a formula in the trigger coloumn on my triggers worksheet its copying over the formula instead of the trigger that i want gruss to fire into the market.

Any help appreciated
vulturesquad
 
Posts: 10
Joined: Fri Mar 20, 2020 3:41 pm

Re: Help with Garry's example Multiple Trigger code

Postby alrodopial » Fri Jan 01, 2021 12:22 pm

If I got it right replace the
Code: Select all
.Range(.Cells(triggerRow, 1), .Cells(triggerRow, 3)).Copy Range(Cells(r, 17), Cells(r, 19))

with the
Code: Select all
Range(Cells(r, 17), Cells(r, 19)).Value = .Range(.Cells(triggerRow, 1), .Cells(triggerRow, 3)).Value
alrodopial
 
Posts: 1353
Joined: Wed Dec 06, 2006 9:59 pm

Re: Help with Garry's example Multiple Trigger code

Postby vulturesquad » Sat Jan 02, 2021 12:29 pm

alrodopial wrote:If I got it right replace the
Code: Select all
.Range(.Cells(triggerRow, 1), .Cells(triggerRow, 3)).Copy Range(Cells(r, 17), Cells(r, 19))

with the
Code: Select all
Range(Cells(r, 17), Cells(r, 19)).Value = .Range(.Cells(triggerRow, 1), .Cells(triggerRow, 3)).Value



thanks i found some code i had been sent before as well and they work.
Is it possible for the trigger to only work on a selected horse rather than every horse in the race.
vulturesquad
 
Posts: 10
Joined: Fri Mar 20, 2020 3:41 pm

Re: Help with Garry's example Multiple Trigger code

Postby alrodopial » Sat Jan 02, 2021 5:31 pm

I don't remember what were in the sheets but I guess you can modify the formulas in "triggers" with some if statements
to include/exclude current horse
It depends on what do you mean by "selected horse"
the fav of the race, the 5th horse, horse with known name in advance, in every race, in flat races ... etc
alrodopial
 
Posts: 1353
Joined: Wed Dec 06, 2006 9:59 pm

Re: Help with Garry's example Multiple Trigger code

Postby vulturesquad » Mon Jan 04, 2021 10:32 am

alrodopial wrote:I don't remember what were in the sheets but I guess you can modify the formulas in "triggers" with some if statements
to include/exclude current horse
It depends on what do you mean by "selected horse"
the fav of the race, the 5th horse, horse with known name in advance, in every race, in flat races ... etc


Selected horse would be one from my own list.
That list would be on a selectuon worksheet
Could be in any race type
vulturesquad
 
Posts: 10
Joined: Fri Mar 20, 2020 3:41 pm

Re: Help with Garry's example Multiple Trigger code

Postby alrodopial » Mon Jan 04, 2021 10:57 am

vulturesquad wrote:
alrodopial wrote:I don't remember what were in the sheets but I guess you can modify the formulas in "triggers" with some if statements
to include/exclude current horse
It depends on what do you mean by "selected horse"
the fav of the race, the 5th horse, horse with known name in advance, in every race, in flat races ... etc


Selected horse would be one from my own list.
That list would be on a selectuon worksheet
Could be in any race type



Then you should use the "MATCH" formula or the "LOOKUP" formula inside your "IF" statements
I'm sure there were examples in the forum , picking a horse from a list has already been disgust here
alrodopial
 
Posts: 1353
Joined: Wed Dec 06, 2006 9:59 pm


Return to Discussion

Who is online

Users browsing this forum: No registered users and 17 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.