Moderator: 2020vision
by allgreen » Mon Apr 02, 2007 10:40 am
by Mitch » Mon Apr 02, 2007 6:08 pm
by dermag » Mon Apr 02, 2007 7:05 pm
If Target.Columns.Count <> 16 Then Exit Sub '16 cols for the API version, 13 for the WEB version of the software.
Application.EnableEvents = False 'essential as any change will result in a possible endless loop and possible lock-up
Dim runners As Integer
Dim sourceRange As Range
Dim destRange As Range
Dim profitSource As Range
Dim profitDest As Range
Set profitSource = Range("X5:X28") 'presumably the range where your proit/loss appears
Set profitDest = Range("AA5:AA28") 'blank range that isn't used on your sheet CHANGE IF NEED BE
runners = WorksheetFunction.CountA(Range("A5:A40")) 'counts the current race runners, upto 36 runners
If WorksheetFunction.Sum(profitDest) <> WorksheetFunction.Sum(profitSource) Then 'identifies change and snapshots
Range("A45") = "Previous Snapshots"
Set sourceRange = Range(Cells(1, 1), Cells(1, 1).Offset(runners + 4, 100)) 'This is the current region used
Set destRange = Range((Cells(Rows.Count, "A").End(xlUp).Offset(6, 0)), Cells(Rows.Count, "A").End(xlUp).Offset(runners + 10, 100)) 'captures 100 columns
destRange.Value = sourceRange.Value
End If
profitDest.Value = profitSource.Value 'replaces old data with new updated data
Application.EnableEvents = True
by allgreen » Mon Apr 02, 2007 10:39 pm
The Worksheet_SelectionChange event will only fire when the active cell changes either by you clicking in a different cell or a macro selecting a different cell. BA will never trigger a selectionchange event.
You could check to see if any of the P/L figures have changed using the worksheet_change event handler but then you'll get the state of the market when the bet is matched rather than when the bet is placed
by dermag » Tue Apr 03, 2007 1:21 pm
by allgreen » Tue Apr 03, 2007 2:26 pm
by dermag » Tue Apr 03, 2007 2:44 pm
by GeorgeUK » Tue Apr 03, 2007 3:24 pm
by allgreen » Tue Apr 03, 2007 3:31 pm
by dermag » Tue Apr 03, 2007 3:41 pm
by allgreen » Tue Apr 03, 2007 4:01 pm
by allgreen » Tue Apr 03, 2007 4:05 pm
by dermag » Tue Apr 03, 2007 7:13 pm
Private Sub Worksheet_Calculate()
If Range("x1") = Range("aa1") Or Range("x1") = 0 Then Exit Sub 'indicates no change or new race
'Everything under here runs if there is a change in X1
Dim runners As Integer
Dim sourceRange As Range
Dim destRange As Range
Application.EnableEvents = False
runners = WorksheetFunction.CountA(Range("A5:A40")) 'counts the current race runners, upto 36 runners
Range("A45") = "Previous Snapshots"
Set sourceRange = Range(Cells(1, 1), Cells(1, 1).Offset(runners + 4, 100)) 'This is the current region used
Set destRange = Range((Cells(Rows.Count, "A").End(xlUp).Offset(6, 0)), Cells(Rows.Count, "A").End(xlUp).Offset(runners + 10, 100)) 'captures 100 columns
destRange.Value = sourceRange.Value
Range("AA1").Value = Range("x1").Value
Range("z1") = Range("z1") + 1 'this row was just a debugging thing, it count the number snapshots and displayed on the sheet
Application.EnableEvents = True
End Sub
by Mitch » Wed Apr 04, 2007 12:29 am
If Target.Columns.Count <> 16 Then Exit Sub
by dermag » Wed Apr 04, 2007 10:28 am
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.