Private Sub Worksheet_Calculate()
Call Betrow1
End Sub
Sub Betrow1()
'Decides whether to back or lay according to calculations in excel'
If Range("L13") = "Back" Then
Call Back_Offsetrow1
ElseIf Range("L13") = "Lay" Then
Call Lay_Offsetrow1
End If
End Sub
Sub Back_Offsetrow1()
'If a back is triggered then this selects the odds and the stake'
Range("Q5") = "BACK"
Range("R5") = "=F5"
Range("S5") = "2"
'triggers for the matched check procedure to be carried out'
Call Matchedrow1
End Sub
Sub Matchedrow1()
'to check if matched stake = stake, using counter to try and create a loop until it is matched'
Dim Counter As Integer
Counter = 0
If Range("W5") = Range("S5") Then Counter = Counter + 1
'if matched then moves onto clear row procedure'
If Counter = 1 Then Call clearlayrow1
End Sub
Sub clearlayrow1()
'triggers for clear to appear in trigger cell and clear the odds and stake box'
Range("Q5") = "CLEAR"
Range("R5:S5").Clear
'triggers for the lay part to be carried out'
Call layrow1
End Sub
Sub layrow1()
'lay procedure where takes the back stake - 0.1 and then works out the stake'
Range("Q5") = "LAY"
Range("R5") = "=F5-0.1"
Range("S5") = "=(F5/R5])* 2"
'calls for matched lay bet procedure to be carried out'
Call matchedlayrow1
End Sub
Sub matchedlayrow1()
Dim Counter As Integer
Counter = 0
If Range("W5") = Range("S5") Then Counter = Counter + 1
'if matched then moves onto clear row procedure'
If Counter = 1 Then Call clearrow1
End Sub
Sub clearrow1()
'triggers for clear trigger to begin and clear odds and stake'
Range("Q5") = "CLEAR"
Range("R5:S5").Clear
End Sub
So far it goes okay until the first check to see if the matched back stake has been matched. but the problem is that i dont know how to loop until the matched stake has been matched.
there are a few other problems as you can probably see but ive never used vba before so any tips on how to do the above or any other errors that you can see would be much appreciated
cheers
paul