george hart
Board Regular
- Joined
- Dec 4, 2008
- Messages
- 241
Hi all
The code below works great in that it pops up a message showing the min value in column Q, but I need to search through the remaining column (Q) and if the min value is found anywhere within that column the message to advise on all those with the same value as the min value.
In short, find min value and if duplicated or not a message advising of all min values in column Q.
Something like ive ighlighted in bold perhaps?
Dim MaxVal As Double
Dim Row As Long
MinVal = Application.WorksheetFunction. _
Min(Range("Q:Q"))
For Row = 1 To Cells(Rows.Count, "Q").End(xlUp).Row
If Range("Q3" & X).Value = MinVal Then
Range("Q3" & X).Select
If Range("Q3" & X).Value = Selection Then Range("Q3" & X).Select
MsgBox "The next procedure up for peer review is " & Selection.Offset(0, -14).Value & " on the " & ActiveCell
Exit For
End If
Next Row
End Sub
Many thanks in advance
The code below works great in that it pops up a message showing the min value in column Q, but I need to search through the remaining column (Q) and if the min value is found anywhere within that column the message to advise on all those with the same value as the min value.
In short, find min value and if duplicated or not a message advising of all min values in column Q.
Something like ive ighlighted in bold perhaps?
Dim MaxVal As Double
Dim Row As Long
MinVal = Application.WorksheetFunction. _
Min(Range("Q:Q"))
For Row = 1 To Cells(Rows.Count, "Q").End(xlUp).Row
If Range("Q3" & X).Value = MinVal Then
Range("Q3" & X).Select
If Range("Q3" & X).Value = Selection Then Range("Q3" & X).Select
MsgBox "The next procedure up for peer review is " & Selection.Offset(0, -14).Value & " on the " & ActiveCell
Exit For
End If
Next Row
End Sub
Many thanks in advance