Forums

General Betting

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.

Post your reply

Text Format: Table: Smilies:
Forum does not support HTML
Insert Photo
Cancel
sort by:
Show
per page
Replies: 18
By:
modk
When: 09 Mar 10 16:25
vba
By:
getting better
When: 09 Mar 10 17:19
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.
By:
modk
When: 09 Mar 10 17:33
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
By:
imlac1
When: 09 Mar 10 18:52
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
By:
Ghetto Joe
When: 09 Mar 10 18:53
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
By:
Wrong Hole Poker
When: 09 Mar 10 18:54
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
By:
Wrong Hole Poker
When: 09 Mar 10 19:25
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 ?
By:
modk
When: 09 Mar 10 19:29
For Loop

one of the above more familiar coders will amend it for you :)
By:
Ghetto Joe
When: 09 Mar 10 19:48
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
By:
dlarssonf
When: 09 Mar 10 19:54
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
By:
Ghetto Joe
When: 09 Mar 10 20:08
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
By:
dlarssonf
When: 09 Mar 10 20:10
yep cheers ghetto Joe, thanks for your time
By:
Wrong Hole Poker
When: 09 Mar 10 20:12
works a treat Ghetto Joe nice one ;)
By:
Ghetto Joe
When: 09 Mar 10 20:26
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
By:
Wrong Hole Poker
When: 11 Mar 10 14:31
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?
By:
tonymontana
When: 11 Mar 10 17:17
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 :(
By:
dlarssonf
When: 11 Mar 10 17:24
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
By:
tonymontana
When: 11 Mar 10 17:49
nice, thanks
sort by:
Show
per page

Post your reply

Text Format: Table: Smilies:
Forum does not support HTML
Insert Photo
Cancel
‹ back to topics
www.betfair.com