Moderator: 2020vision
by vanbuuts » Thu Jan 22, 2015 5:14 pm
by vanbuuts » Thu Jan 22, 2015 5:24 pm
Private Sub Worksheet_Change(ByVal Target As Range)
'Game goes in play
If Range("E2").Value = "In Play" And Range("F33").Value = "" Then
Me.Activate
Game_Starts
End If
End Sub
Private Sub Worksheet_Calculate()
'Fix pre match odds
If Range("G33").Value = 1 Then
Me.Activate
Odds2
End If
'Fix pre match Formulas
If Range("G33").Value = 2 Then
Me.Activate
Formulas2
End If
'After Game Changes
If Range("G33").Value = 3 Then
Me.Activate
Reset
End If
' Play suspends
If Range("F39").Value = 11 Then
Me.Activate
SuspendLay
End If
' Play suspends
If Range("F39").Value = 1 Then
Me.Activate
Suspend
End If
' Goal before30
If Range("F34").Value = 3 Then
Me.Activate
Early
End If
'Run initial lay bet
If Range("F35").Value = 1 Then
Me.Activate
Initial
Freeze
End If
' Lay odds matched
If Range("K9").Value = 1 Then
Me.Activate
Lay
End If
' Under dog scores first
If Range("F36").Value = 1 Then
Me.Activate
Dog
End If
' Dog odds matched
If Range("K11").Value = 1 Then
Me.Activate
Dog2
End If
'No goal at 70 mins
If Range("F37").Value = "1" Then
Me.Activate
No_Goal
End If
' Favourite scores first
If Range("F38").Value = 1 Then
Me.Activate
Fav
End If
' Fav odds matched
If Range("K10").Value = 1 Then
Me.Activate
Fav2
End If
' Reset Game
If Range("N21").Value = 1 Then
Me.Activate
Reset
End If
' Reset Game
If Range("Q19").Value = 1 Then
Me.Activate
Reset
End If
End Sub
by Captain Sensible » Thu Jan 22, 2015 5:44 pm
by Captain Sensible » Thu Jan 22, 2015 5:46 pm
by vanbuuts » Thu Jan 22, 2015 6:18 pm
by Captain Sensible » Thu Jan 22, 2015 7:19 pm
by vanbuuts » Thu Jan 22, 2015 7:44 pm
Private Sub Worksheet_Calculate()
'Fix pre match odds
If Range("G33").Value = 1 Then
Me.Activate
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
Odds2
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End If
'Fix pre match Formulas
If Range("G33").Value = 2 Then
Me.Activate
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
Formulas2
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End If
'After Game Changes
If Range("G33").Value = 3 Then
Me.Activate
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
Reset
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End If
' Play suspends
If Range("F39").Value = 11 Then
Me.Activate
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
SuspendLay
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End If
' Play suspends
If Range("F39").Value = 1 Then
Me.Activate
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
Suspend
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End If
' Goal before30
If Range("F34").Value = 3 Then
Me.Activate
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
Early
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End If
'Run initial lay bet
If Range("F35").Value = 1 Then
Me.Activate
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
Initial
Freeze
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End If
' Lay odds matched
If Range("K9").Value = 1 Then
Me.Activate
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
Lay
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End If
' Under dog scores first
If Range("F36").Value = 1 Then
Me.Activate
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
Dog
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End If
' Dog odds matched
If Range("K11").Value = 1 Then
Me.Activate
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
Dog2
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End If
'No goal at 70 mins
If Range("F37").Value = "1" Then
Me.Activate
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
No_Goal
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End If
' Favourite scores first
If Range("F38").Value = 1 Then
Me.Activate
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
Fav
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End If
' Fav odds matched
If Range("K10").Value = 1 Then
Me.Activate
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
Fav2
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End If
' Reset Game
If Range("N21").Value = 1 Then
Me.Activate
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
Reset
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End If
' Reset Game
If Range("Q19").Value = 1 Then
Me.Activate
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
Reset
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End If
End Sub
by rourkem » Sun Jan 25, 2015 1:29 am
by Captain Sensible » Sun Jan 25, 2015 2:53 pm
rourkem wrote:Hi. I have tried this but I still not working. Am I missing something by any chance?
Private Sub Worksheet_Change(ByVal Target As Range)
Static MyMarket As Variant
If Target.Columns.Count <> 16 Then Exit Sub
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
If [A1].Value = MyMarket Then
If Range("E2").Value <> "In Play" And Range("F2").Value = "" Then
Range("AA5:AA50").Value = Range("F5:F50").Value
End If
If Application.WorksheetFunction.IsText(Range("D2")) And Range("AB1").Value <> "Copied" And Range("F2").Value <> "" Then
On Error GoTo Switch_Market
Range("AC1").Value = Range("AC1").Value + 1
If Range("AC1").Value > 2 Then
Range("AB1").Value = "Copied"
Dim LastDataCell As Long
Dim LastMarketCell As Long
LastDataCell = Sheets("Sheet2").Range("A3000").End(xlUp).Offset(1, 0).Row - 1
LastMarketCell = Sheets("Sheet1").Range("A60").End(xlUp).Offset(1, 0).Row - 1
Worksheets("Sheet1").Range("A1:A" & LastMarketCell).Copy Destination:=Worksheets("Sheet2").Range("A" & LastDataCell) 'runner name
Worksheets("Sheet1").Range("X1:X" & LastMarketCell).Copy Destination:=Worksheets("Sheet2").Range("B" & LastDataCell) 'profit/loss
Worksheets("Sheet1").Range("AA1:AA" & LastMarketCell).Copy Destination:=Worksheets("Sheet2").Range("C" & LastDataCell) 'last odds
Worksheets("Sheet2").Range("D" & LastDataCell) = WorksheetFunction.Max(Worksheets("Sheet1").Range("X5:X60"))
Worksheets("Sheet2").Range("D" & LastDataCell).NumberFormat = "£#,##0.00"
GoTo Switch_Market
End If
End If
Else
MyMarket = [A1].Value
Range("AB1").Value = ""
Range("Q2").Value = 2
Range("AC1").Value = 0
End If
Xit:
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
Exit Sub
Switch_Market:
Range("Q2").Value = -1
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End Sub
by vanbuuts » Sun Jan 25, 2015 10:36 pm
Application.Wait Now + TimeValue("00:00:30")
by Captain Sensible » Sun Jan 25, 2015 11:06 pm
by vanbuuts » Mon Jan 26, 2015 9:16 am
by vanbuuts » Wed Jan 28, 2015 10:57 am
Dim StartTime As Single
StartTime = Timer
Do While Timer - StartTime <= 5
DoEvents
Loop
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.