ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   how do i find the last time i picked a winner (https://www.excelbanter.com/excel-discussion-misc-queries/166871-how-do-i-find-last-time-i-picked-winner.html)

AussieGambler

how do i find the last time i picked a winner
 
i keep a record of my horse selections and there placing. How do I find the
last time I won as a count.
EG. column is
1
10
3
4
7
hence won 5 bets ago.

Mike H

how do i find the last time i picked a winner
 
You could right click the sheet tab, view code and paste this in. As you add
your results to column A then B1 will show your last winnner

Private Sub Worksheet_Change(ByVal Target As Range)
Count = 1
If Not Intersect(Target, Range("A1:A100")) Is Nothing Then' change to suit
lastrow = Range("A65536").End(xlUp).Row
For x = lastrow To 1 Step -1
If Cells(x, 1).Value < 1 Then
Count = Count + 1
Else
Application.EnableEvents = False
Cells(1, 2).Value = "Your last winner was " & Count & " races ago"
Application.EnableEvents = True
Exit Sub
End If
Next
End If
End Sub

Mike

"AussieGambler" wrote:

i keep a record of my horse selections and there placing. How do I find the
last time I won as a count.
EG. column is
1
10
3
4
7
hence won 5 bets ago.


AussieGambler

how do i find the last time i picked a winner
 
Thanks mate it worked great. With 20 systems being followed it is a great
time saver.
"AussieGambler" wrote:

i keep a record of my horse selections and there placing. How do I find the
last time I won as a count.
EG. column is
1
10
3
4
7
hence won 5 bets ago.


AussieGambler

how do i find the last time i picked a winner
 
Thanks it was of great use and I have other uses for it. TY

"Mike H" wrote:

You could right click the sheet tab, view code and paste this in. As you add
your results to column A then B1 will show your last winnner

Private Sub Worksheet_Change(ByVal Target As Range)
Count = 1
If Not Intersect(Target, Range("A1:A100")) Is Nothing Then' change to suit
lastrow = Range("A65536").End(xlUp).Row
For x = lastrow To 1 Step -1
If Cells(x, 1).Value < 1 Then
Count = Count + 1
Else
Application.EnableEvents = False
Cells(1, 2).Value = "Your last winner was " & Count & " races ago"
Application.EnableEvents = True
Exit Sub
End If
Next
End If
End Sub

Mike

"AussieGambler" wrote:

i keep a record of my horse selections and there placing. How do I find the
last time I won as a count.
EG. column is
1
10
3
4
7
hence won 5 bets ago.



All times are GMT +1. The time now is 01:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com