I'm trying to find the cell address for the lowest number in a column. This does not seem to be working when the number is 0. Can someone please help me figure out what's wrong with this code. It works when there aren't any 0's in the column.
Thanks in advance
Trevor
Function MinAddress(rng)
Set rng = Columns(22)
' Sets variable equal to minimum value in the input range.
MinNum = Application.Min(rng)
' Loop to check each cell in the input range to see if equals the
' MinNum variable.
For Each cell In rng.Cells
If cell = MinNum Then
' If the cell value equals the MinNum variable it
' returns the address to the function and exits the loop.
MinAddress = cell.Address
Exit For
End If
Next cell
End Function
Bookmarks