I am working on a code that selects a range of cells but I cannot figure out how to find the maximum value between the selected cells only.
Any idea on how to fix this? Here is what I have so far:
Function MaxContribution(ws As Worksheet)
Dim max As Double
ws.Range("$B$16:$D$1000").AutoFilter Field:=1, Criteria1:="="
Range("D17:D1000").Select
max = Application.WorksheetFunction.max(activerange)
MaxContribution = max
End Function