Capture Range on Going In Play

Find a developer for your Excel triggered betting needs and advertise your development service here.

Moderator: 2020vision

Re: Capture Range on Going In Play

Postby Captain Sensible » Fri Oct 11, 2019 1:30 pm

The above code should be as below, I'd changed the E2 to F2 so I could run it on the greyhounds quickly

Code: Select all
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo xit
Dim x As Integer, y As Integer
Dim Wb As Workbook
Set Wb = ThisWorkbook
x = Wb.Sheets("Sheet1").Cells(Rows.Count, "A").End(xlUp).Row
y = Wb.Sheets("Sheet3").Cells(Rows.Count, "A").End(xlUp).Row

    If Target.Columns.Count <> 7 Then Exit Sub  'Amend the number to the cells that change with the BSP data
        Application.EnableEvents = False 'Turn off events so changes to cell don't retrigger event
        Application.Calculation = xlCalculationManual
        If Wb.Sheets("Sheet1").Range("A1").Value = Wb.Sheets("Sheet1").Range("T1").Value Then GoTo xit
        If Wb.Sheets("Sheet1").Range("E2").Value = "In Play" Then
                Wb.Sheets("Sheet1").Range("T1").Value = Wb.Sheets("Sheet1").Range("A1").Value
                Wb.Sheets("Sheet3").Range("A" & y + 1 & ":Z" & x + y).Value = Wb.Sheets("Sheet1").Range("A1:Z" & x).Value
        End If

        Application.Calculation = xlCalculationAutomatic
        Application.EnableEvents = True 'Turn on events again
End Sub

User avatar
Captain Sensible
Posts: 2662
Joined: Sat Nov 19, 2005 2:29 pm

Re: Capture Range on Going In Play

Postby AndrewP » Fri Oct 11, 2019 2:31 pm

Again, it works perfectly CaptainS. I can now work on other spreadsheets while final pre-race position for the extra place markets is logged in the background..

I'm most grateful, I'd spent hours trying to fathom this one out.

Thanks again,

Posts: 39
Joined: Sat Nov 03, 2007 10:52 am


Return to Find an Excel developer

Who is online

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