Moderator: 2020vision
by menlolot » Thu Apr 02, 2009 7:12 am
by GaryRussell » Thu Apr 02, 2009 4:44 pm
by Bumble » Tue Aug 03, 2010 9:02 am
by GaryRussell » Tue Aug 03, 2010 9:07 am
by osknows » Tue Aug 03, 2010 11:26 am
Bumble wrote:What I'm aiming to do is set up a couple of arrays, eg one of prices and another from MyBets. I'd like to index those arrays with a runner number. When working from data in both arrays, I'd rather avoid continually searching through to match a runner name. I'd like to know that if "My Certain Winner" is at, say, cells A10:P10 when I start logging prices to Sheet 1 then it will stay there (so I can use an index into my arrays and store it to cross-refer).
Sub test()
load_array = Range("a5:z100").Value
array_index = WorksheetFunction.Match("Horse 15", WorksheetFunction.Index(load_array, 0, 1), 0)
End Sub
by osknows » Tue Aug 03, 2010 12:54 pm
Sub test()
Set load_array = Range("a5:z100")
array_index = WorksheetFunction.Match("Horse 15", WorksheetFunction.Index(load_array, 0, 1), 0)
End Sub
by osknows » Tue Aug 03, 2010 1:37 pm
Private Declare Function GetTickCount Lib "kernel32" () As Long
Sub test()
Dim nTime
nTime = GetTickCount
Set load_array = Range("a5:z65000")
array_index = WorksheetFunction.Match("Horse 15", WorksheetFunction.Index(load_array, 0, 1), 0)
rngtimer = GetTickCount - nTime
nTime = GetTickCount
load_array = Range("a5:z65000").Value
array_index = WorksheetFunction.Match("Horse 15", WorksheetFunction.Index(load_array, 0, 1), 0)
arraytimer = GetTickCount - nTime
nTime = GetTickCount
load_array = Range("a5:z65000").Value
For a = LBound(load_array) To UBound(load_array)
If load_array(a, 1) = "Horse 15" Then
array_index = a
End If
Next
arraylooptimer = GetTickCount - nTime
nTime = GetTickCount
For a = 1 To 65000
If Range("a5").Offset(a, 0) = "Horse 15" Then
array_index = a
End If
Next
excelooptimer = GetTickCount - nTime
MsgBox ("Range Search: " & rngtimer & vbCrLf & _
"Array Search: " & arraytimer & vbCrLf & _
"ArrayLoop Search: " & arraylooptimer & vbCrLf & _
"ExcelLoop Search: " & excelooptimer)
End Sub
by Bumble » Tue Aug 03, 2010 9:17 pm
by osknows » Tue Aug 03, 2010 9:42 pm
by Bumble » Fri Aug 06, 2010 7:59 pm
by osknows » Fri Aug 06, 2010 9:11 pm
Sub test()
Dim newarray() As Variant
'combine several ranges into one range
Set rnga = Range("A1:Q1") 'define range explicitly
Set rngb = Range(Range("A5"), Range("A5").Offset(0, 11)) 'using offset to define range
Set rngc = Range("A10:Q10")
Set rngd = Union(rnga, rngb, rngc) ' combine ranges into one range
'==========================
'quickest method allows rng object & array
Set rnga = Range("A1:Q1")
arraya = rnga
'use the rnga object for quickest method to filter/search/index
'use the arraya array to calculate values and write back
Range("A1:Q1").Value = arraya
'=============================================
'slower method of filling a new array searches for value "x" and fills new array with matches
Set rnga = Range("A1:Q10")
Count = Application.CountIf(rnga, "x") 'count instances of "x"
ReDim newarray(1 To Count, 1 To rnga.Columns.Count)
newarraycount = 1
For i = 1 To rnga.Rows.Count
If rnga.Cells(i, 1) = "x" Then
For j = 1 To rnga.Columns.Count
newarray(newarraycount, j) = rnga.Cells(i, j)
Next
newarraycount = newarraycount + 1
End If
Next
Range(Range("A21"), Range("A21").Offset(UBound(newarray, 1) - 1, UBound(newarray, 2) - 1)) = newarray
End Sub
by Bumble » Sat Aug 07, 2010 8:36 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.