LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Lowest repeatable number in a range

I am trying to come up with a function or some way to return the lowest
repeatable number in a range of numbers. Here is a function that I
have. It works but does not look pretty. Does anyone have a better
routine or idea to acomplish this?

Thanks
Scott

Function LowestRepeatableNumber(myRange As Range)
Dim LastCount As Integer
Dim LowestNumber
LastCount = 0
LowestNumber = Application.WorksheetFunction.Max(myRange)
For Each Value In myRange
If Value = 0 Then GoTo 10
b = Application.WorksheetFunction.CountIf(myRange, Value)
If b 2 And Value < LowestNumber Then
LowestNumber = Value
End If
10 Next Value
LowestRepeatableNumber = LowestNumber
End Function

 
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
Repeatable crash in Custom Error Bar range selection Daniel Trojan[_2_] Excel Discussion (Misc queries) 2 October 28th 13 04:34 AM
determine lowest number in several columns and replace lowest numb jerry Excel Worksheet Functions 1 June 18th 08 03:19 AM
Formula for displaying the lowest number of a range? coal_miner Excel Worksheet Functions 1 April 25th 05 02:54 PM
Range vs. lowest #, 2nd lowest #, 3rd lowest #, etc jwebb Excel Discussion (Misc queries) 2 March 9th 05 12:38 PM
How can I get the lowest price, second lowest etc. from a range o. Robin Excel Worksheet Functions 2 November 9th 04 12:23 PM


All times are GMT +1. The time now is 04:21 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"