View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
OssieMac OssieMac is offline
external usenet poster
 
Posts: 2,510
Default Using WorksheetFunction.Max()

Hi Dave,

WorksheetFunction.Max(Range("Line"))

Using line the way you did VBA thinks that it is a VBA variable not a named
range.



Regards,

OssieMac



"Dave" wrote:

I have a worksheet where A1:A10 is a named range "Line"
and C1:C10 is named "Qty".
Each cell in "Line" has the formula =IF(ISNUMBER(Qty),ROW(),"")
The worksheet function =Max(Line) will return the highest value in the range
"Line".
When I try to use WorksheetFunction.Max(Line) in VBA, it always returns 0
(zero).
How can I correctly use the code to match the results of the worksheet
function?
Thanks very much.