Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default 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.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default 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.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default 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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying winner/first four placings. Toobi-Won Kenobi Excel Worksheet Functions 5 April 28th 07 05:18 PM
Formula to display the winner Toobi-Won Kenobi Excel Worksheet Functions 6 April 27th 07 03:04 PM
Can Excel randomly pick one winner out of 100 contest entries? Bernard Excel Discussion (Misc queries) 4 March 30th 07 04:28 PM
Posts not getting picked up T. Valko Excel Discussion (Misc queries) 5 March 28th 07 01:58 AM
If certain item is picked, then text added... roger_home Excel Discussion (Misc queries) 6 February 12th 06 10:39 PM


All times are GMT +1. The time now is 04:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"