Hello,
I am trying to write a procedure in VBA for excel to find the lowest negative value from a selected range. If there are no negative values, then a message box should display "There are no negative values" Below is what I have so far, but I'm not sure if it si correct or how to compare each case to the previous. Thanks for any help.
![]()
Sub LowestNegative() Dim Lowest As Single For Each c In Selection.Cells Select Case c.Value Case Is < 0 Lowest = ActiveCell.Value Case Is > 0 Lowest = MsgBox("There are no negative values.") Case Else Lowest = MsgBox("There are no negative values.") End Select Next End Sub
Bookmarks