Hi all- I'm simply trying to find the max value in a range and select that cell. For values >0, the following works well. However, for values < 0, the entire range is selected. Any thoughts on how to remedy this?
Sub GoToMax()
Dim WorkRange As Range
ActiveSheet.Range("F9:F17").Select
If TypeName(Selection) <> "Range" Then Exit Sub
Set WorkRange = Selection
MaxVal = Application.Max(WorkRange)
On Error Resume Next
WorkRange.Find(What:=MaxVal, _
After:=WorkRange.Range("A1"), _
LookIn:=xlValues, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False _
).Select
End Sub
Sub GoToMax()
Dim WorkRange As Range
ActiveSheet.Range("F9:F17").Select
If TypeName(Selection) <> "Range" Then Exit Sub
Set WorkRange = Selection
MaxVal = Application.Max(WorkRange)
On Error Resume Next
WorkRange.Find(What:=MaxVal, _
After:=WorkRange.Range("A1"), _
LookIn:=xlValues, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False _
).Select
End Sub