View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
bobbo bobbo is offline
external usenet poster
 
Posts: 56
Default Find Maximum value in a range via macro

I think this should do it

j = worksheetfunction.max(range("A6:A50"))

Names("LINE").RefersToRange.value = j


swatsp0p wrote:
I am trying to find, in a macro, the maximum value in the range A6:A50 on
sheet 2 as value 'J'. I then want to place that value in the cell named
"Line" as such:
Range("LINE").Value = J.

Any ideas on how to go about this. I can't seem to find a 'maximum' object
and the 'xlmaximum' doesn't seem to fit the circumstance.

Thanks in advance,

Bruce
--
The older I get, the better I used to be.