Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple question to find min value
I'm running the macro below to find the minimum value, but the compiler keeps giving me an error at 'If cell = MinNum Then' . Can someone see what's wrong with this? Function MinAddress(rng) Set rng = Columns(22) ' Sets variable equal to maximum value in the input range. MinNum = Application.Min(rng) ' Loop to check each cell in the input range to see if equals the ' MaxNum variable. For Each cell In rng If cell = MinNum Then ' If the cell value equals the MaxNum variable it ' returns the address to the function and exits the loop. MinAddress = cell.Address Exit For End If Next cell End Function Thanks Trevor -- Tre_cool ------------------------------------------------------------------------ Tre_cool's Profile: http://www.excelforum.com/member.php...o&userid=26416 View this thread: http://www.excelforum.com/showthread...hreadid=397876 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Simple Find and Replace Question | New Users to Excel | |||
IF formula-simple question; simple operator | Excel Discussion (Misc queries) | |||
simple find | Excel Worksheet Functions | |||
Simple Simple Excel usage question | Excel Discussion (Misc queries) | |||
simple question, hopefully a simple answer! | Excel Programming |