Moderator: 2020vision
by mak » Wed Jul 26, 2017 2:05 pm 
by Captain Sensible » Wed Jul 26, 2017 2:49 pm 
If (.Range("E2").Value = "In Play" And .Range("F2").Value <> "") Or .Range("F2").Value = "Closed" Then
If Not marketChanging Then
marketChanging = True
currentMarket = .Range("A1").Value
.Range("Q2").Value = -1
Else
If .Range("A1").Value <> currentMarket Then marketChanging = False
End If=getTicks(Range("F5").Value, Range("H5").Value)
by Captain Sensible » Wed Jul 26, 2017 3:10 pm 
'**PUT THIS IN A MODULE SO IS AVAILABLE TO ALL CODE
Public Function LastRow(ByVal rng As Range, Optional Offset As Long) As Long
'The most accurate method to return last used row in a range.
On Error GoTo blankSheetError
    'Identify next blank row
    LastRow = rng.Find(What:="*", SearchDirection:=xlPrevious, SearchOrder:=xlByRows).Row + Offset
    'On Error GoTo 0 'not really needed
    Exit Function
blankSheetError:
    LastRow = 1 'Will produce error if blank sheet so default to row 1 as cannot have row 0
    Resume Next
End Function
by mak » Wed Jul 26, 2017 3:28 pm 
If GetTicks(Range("F5").Value, Range("H5").Value) >= 80 Then
    Cells("Q5").Value = "LAY"
End If
by Captain Sensible » Wed Jul 26, 2017 3:41 pm 
rowFindLast = LastRow(.Range("A:P"), 0)        For i = 5 To rowFindLast 
       Range("S" & i ).Value="Something or other"
        Next i
by Captain Sensible » Wed Jul 26, 2017 3:44 pm 
by Captain Sensible » Wed Jul 26, 2017 3:46 pm 
by alrodopial » Wed Jul 26, 2017 4:37 pm 
mak wrote:i tried the following but it does not working. where is the fault?
by mak » Wed Jul 26, 2017 4:57 pm 
by Captain Sensible » Wed Jul 26, 2017 5:02 pm 
by Captain Sensible » Wed Jul 26, 2017 5:08 pm 
    Option Explicit
    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim rowFindLast As Long
    Dim readArray() As Variant
    Dim i As Long
 Application.EnableEvents = True
        If Target.Columns.Count <> 16 Then Exit Sub
        Application.EnableEvents = False
        With Target.Parent
                
            rowFindLast = LastRow(.Range("A:S"), 0) 'get the last row
            readArray = .Range("A1:S" & rowFindLast).Value 'put our data into an array
            .Range("S1").Value = 6
            
            For i = 5 To UBound(readArray, 1) 'using 5 rather than LBound(readArray, 1) because we only want price data now
                
                
            If getTicks(CCur(readArray(i, 6)), CCur(readArray(i, 8))) > 1 Then
            readArray(i, 19) = "over 1 tick"
            readArray(i, 18) = getTicks(CCur(readArray(i, 6)), CCur(readArray(i, 8))) 'display ticks
            Else
            readArray(i, 19) = "under 1 tick"
            readArray(i, 18) = "" ' we clear cell incase it still holds data from previous refresh
            End If
    
            
            Next i
           
           .Range("A1:S" & rowFindLast).Value = readArray 'dump our amended arrayback to the sheet
       
        End With
        Application.EnableEvents = True
    End Sub
by mak » Wed Jul 26, 2017 5:29 pm 
by Captain Sensible » Wed Jul 26, 2017 5:36 pm 
mak wrote:Captain
what CCur is?
If Target.Columns.Count <> 16 Then Exit Sub
by Captain Sensible » Wed Jul 26, 2017 5:41 pm 
  Option Explicit
    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim rowFindLast As Long
    Dim readArray() As Variant
    Dim i As Long
        If Target.Columns.Count <> 16 Then Exit Sub
        Application.EnableEvents = False
         Range("S1").Value = Application.EnableEvents
        With Target.Parent
               
            rowFindLast = LastRow(.Range("A:S"), 0) 'get the last row
            readArray = .Range("A1:S" & rowFindLast).Value 'put our data into an array
          
           
            For i = 5 To UBound(readArray, 1) 'using 5 rather than LBound(readArray, 1) because we only want price data now
               
               
            If getTicks(CCur(readArray(i, 6)), CCur(readArray(i, 8))) > 1 Then
            readArray(i, 19) = "over 1 tick"
            readArray(i, 18) = getTicks(CCur(readArray(i, 6)), CCur(readArray(i, 8))) 'display ticks
            Else
            readArray(i, 19) = " 1 tick"
            readArray(i, 18) = "" ' we clear cell incase it still holds data from previous refresh
            End If
   
           
            Next i
           
           .Range("A1:S" & rowFindLast).Value = readArray 'dump our amended arrayback to the sheet
       
        End With
        Application.EnableEvents = True
       Range("S1").Value = Application.EnableEvents
    End SubThe 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.


