define max in range (macro)

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

I want to define a constant in my macro to be the max value in column D from
row 2 to the last row. I'm sure this is an easy one but can't come up with
the code.
 
Sorry...didn't mean to post twice. I got an error message on the other one
that there was a connection error.
 
Hi,

MaxVal = WorksheetFunction.Max(Range("D2:D" & Cells(Rows.Count,
"D").End(xlUp).Row))

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top