Forums

General Betting

Welcome to Live View – Take the tour to learn more
Start Tour
There is currently 1 person viewing this thread.
Wrong Hole Poker
09 Mar 10 16:15
Joined:
Date Joined: 23 Jan 10
| Topic/replies: 448 | Blogger: Wrong Hole Poker's blog
how is it possible to count how many time a cell changes value please? i.e if A1 changes five times then A2 would = 5.
Pause Switch to Standard View Excel Question
Show More
Loading...
Report modk March 9, 2010 4:25 PM GMT
vba
Report getting better March 9, 2010 5:19 PM GMT
How is it changing?
If the process that makes it change can also trigger a macro to check whether it has changed and updated the count, then great.
But if something else is making it change then it is impossible to know if it changes very quickly or not. Like on Betfair in running on a race you soemtimes dont see all the rpcies as they change so fast and you can only press refresh so many time.
Also what about if it hcnages jsut a very little bit, does not count as a change?
I mean if you asked me if it was possible to count how many times the temperature changed in a room, then I would have to ask you what you defined as a change.
If a small insect flies across the room creating a small air movement that migth cool the room. On the other hand if it burns energy flying then it might increase the temperature of the room.
You need to tell me what sort of insect it is.
Report modk March 9, 2010 5:33 PM GMT
im sure its something very simple in vba like

----------------
onworkbookcellchange(a1)

a2=a2+1
----------------

obviously thats not the correct code (my vba is pretty rusty) but im sure that type of approach would work
Report imlac1 March 9, 2010 6:52 PM GMT
If changing cell is row 5, column 5 then this will increment A1 every time the cell changes:

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Row = 5 And Target.Column = 5 Then
Cells(1, 1) = Cells(1, 1) + 1
End If

End Sub
Report Ghetto Joe March 9, 2010 6:53 PM GMT
something like this should work OK

Private Sub Worksheet_Change(ByVal Target As Range)
Static Count As Variant
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
If [A1].Value = MyMarket Then
GoTo Xit
Else
Count = [A1].Value

[A2].Value = [A2].Value + 1
End If
Xit:
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End Sub
Report Wrong Hole Poker March 9, 2010 6:54 PM GMT
Sorted thanks. :)

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address "$A$1" Then Exit Sub
Range("$B$1") = Range("$B$1")+1
End Sub
Report Wrong Hole Poker March 9, 2010 7:25 PM GMT
how would it possible to edit the above code so that a change in A1 would count on B1, a change in A2 would count in B2 and A3 count in B3 ?
Report modk March 9, 2010 7:29 PM GMT
For Loop

one of the above more familiar coders will amend it for you :)
Report Ghetto Joe March 9, 2010 7:48 PM GMT
Couldn't get your code to work on my version of excel but using imlac's code

Private Sub Worksheet_Change(ByVal Target As Range)

For i = 1 To 3

If Target.Row = i And Target.Column = 1 Then
Cells(i, 2) = Cells(i, 2) + 1
End If
Next i
End Sub
Report dlarssonf March 9, 2010 7:54 PM GMT
quick question re your formula posted @ 19.53 Ghetto Joe,

is it possible to display the five different values that where in a cell in a new column of data?

Thanks
Report Ghetto Joe March 9, 2010 8:08 PM GMT
yes you can keep track of previous odds changes, I'm assuming your using gruss?

you just include stuff like

For i = 5 To 35
Cells(i, 27) = Cells(i, 15)
Next i

within your code and that would copy the contents of F5:F40 (last price matched) into AA5:AA40

to log a trail of results

For i = 5 To 35
Cells(i, 31) = Cells(i, 30)
Cells(i, 30) = Cells(i, 29)
Cells(i, 29) = Cells(i, 28)
Cells(i, 28) = Cells(i, 27)
Cells(i, 27) = Cells(i, 15)
Next i


you get the idea
Report dlarssonf March 9, 2010 8:10 PM GMT
yep cheers ghetto Joe, thanks for your time
Report Wrong Hole Poker March 9, 2010 8:12 PM GMT
works a treat Ghetto Joe nice one ;)
Report Ghetto Joe March 9, 2010 8:26 PM GMT
Wrong Hole Poker imlacs code will increase count if the same value is entered in the cell I just added a For loop to it t show how to include For

If you're entering data manually that'd be ok but if data is being entered automated and the same value i.e. 5 overwrites a 5 it will add one to the count. To avoid that you need to declare the variables as in

Static Count As Variant etc and use things like

If [A1].Value =Count Then

so it wont increase the count if the cell value is the same as the previous value
Report Wrong Hole Poker March 11, 2010 2:31 PM GMT
Private Sub Worksheet_Change(ByVal Target As Range)

For i = 1 To 3

If Target.Row = i And Target.Column = 1 Then
Cells(i, 2) = Cells(i, 2) + 1
End If
Next i
End Sub

The above code works fine when changing the cells manually, however if linked to gruss nothing happens. Any ideas?
Report tonymontana March 11, 2010 5:17 PM GMT
Is there an easy way to see what profit I've made from one type of bet?
Can you arrange so you can see if you've done well by backing 0-0's for example?

I've downloaded the history into excel but I'm not sure how to use it :(
Report dlarssonf March 11, 2010 5:24 PM GMT
http://excel.brainbell.com/

an excellent site that forum name Triggerster gave me yesterday, bookmark and look through it when you have time , great info
Report tonymontana March 11, 2010 5:49 PM GMT
nice, thanks
Post Your Reply
<CTRL+Enter> to submit
Please login to post a reply.

Wonder

Instance ID: 13539
www.betfair.com