Find Row from MAX expression
Dim r as Range, res as Variant, r1 as Range
set r = rngCell.Resize(varcount + 1,1).offset(0,30)
varMaxSalary = Application.Max(varMaxSalary)
res = application.Match(varMaxSalary,r,0)
if not iserror(res) then
set r1 = r(res)
varMaxSalaryRow = r.row
else
varMaxSalaryRow = 1
End if
--
Regards,
Tom Ogilvy
"Dave Birley" wrote:
My objective is to select the row containing the highest value in a
particular column, copy the whole row and paste it in a different WS. I am
using this to find the MAX:
For i = 0 To varCount
varMaxSalary = Max(rngCell(1 + i, 29).Value, rngCell(2 + i,
29).Value)
Next i
..where varCount was earlier determined in a For Loop (SSNs), and rngCell is
selected in the outer For Loop..
What I think I want to do is add a line into this For Loop (or its
replacement) that defines varMaxSalaryRow. Problem is that varMaxSalary is a
Variant, not a Range, so I can't reference the Row from it as it is currently
defined.
Aaaaaargh!
Help, please?
--
Dave
Temping with Staffmark
in Rock Hill, SC
|