LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Harlan Grove
 
Posts: n/a
Default

"Ron Rosenfeld" wrote...
....
Function MaxWinStreak(rg As Range) As Integer
Const Wins As String = "W"
Dim c As Range
Dim TempWins As Integer

For Each c In rg
If c.Text = Wins Then
TempWins = TempWins + 1
Else
If TempWins MaxWinStreak Then MaxWinStreak = TempWins
TempWins = 0
End If
Next c

End Function


If every cell is a win, this function returns zero. If you're going to use
this approach, you have to add another

If TempWins MaxWinStreak Then MaxWinStreak = TempWins

statement after the For loop.




 
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
Winning Streak ParTeeGolfer Excel Worksheet Functions 4 December 31st 04 11:08 PM


All times are GMT +1. The time now is 12:41 PM.

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

About Us

"It's about Microsoft Excel"