Log Price Once

Please post any questions regarding the program here.

Moderator: 2020vision

Log Price Once

Postby Shaun » Fri Oct 01, 2010 6:33 pm

How can i get this to log the information just once, i have a formula in T# that changes to 1 when a bet is placed.

Code: Select all

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Columns.Count <> 16 Then Exit Sub
Application.EnableEvents = False
If [T3].Value <> 1 Then
GoTo Xit
Else
ba_array = ThisWorkbook.Sheets("Data").Range("A1:Z44").Value

With ThisWorkbook.Sheets("Records")

Dim LastRow As Long
LastRow = .Range("A65536").End(xlUp).Row

.Range(.Cells(LastRow + 1, 1), .Cells(LastRow + 1 + UBound(ba_array, 1), 1 + UBound(ba_array, 2))).Value = ba_array

End With
End If
Xit:
Application.EnableEvents = True

End Sub
Shaun
 
Posts: 435
Joined: Fri May 09, 2008 11:11 pm
Location: Kellerberrin, Western Australia

Postby Captain Sensible » Fri Oct 01, 2010 10:44 pm

Why not just set a flag once it's done the copy i.e set T4 to 1 once it's fired



Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Columns.Count <> 16 Then Exit Sub
Application.EnableEvents = False
If [T3].Value <> 1 Then
[T4].Value=0
GoTo Xit
End If

If [T3].Value=1 And [T4].Value<>1 Then

ba_array = ThisWorkbook.Sheets("Data").Range("A1:Z44").Value

With ThisWorkbook.Sheets("Records")

Dim LastRow As Long
LastRow = .Range("A65536").End(xlUp).Row

.Range(.Cells(LastRow + 1, 1), .Cells(LastRow + 1 + UBound(ba_array, 1), 1 + UBound(ba_array, 2))).Value = ba_array
[T4].Value=1
End With
End If
Xit:
Application.EnableEvents = True

End Sub
User avatar
Captain Sensible
 
Posts: 2923
Joined: Sat Nov 19, 2005 2:29 pm

Postby Shaun » Sat Oct 02, 2010 12:11 am

For the amount i use VBA you would think i would learn to understand it more, thanks for your help.
Shaun
 
Posts: 435
Joined: Fri May 09, 2008 11:11 pm
Location: Kellerberrin, Western Australia


Return to Help

Who is online

Users browsing this forum: Google [Bot] and 45 guests

Sports betting software from Gruss Software


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.