Max WorksheetFunction

S

solo

I have a sub that looks like the one below but it gives me an error when I try to run it, it compiles fine and I cannot seem to know whats wrong

sub FindMax(

Dim VarMaxVal As Varian
VarMaxVal =
Dim myRange As Rang

Set myRange = Worksheets("Sheet1").Range("T7:T64"
VarMaxVal= Application.WorksheetFunction.Max(myRange

End Sub
 
F

Frank Kabel

Hi
this works fine for me. what error did you get?
does the sheet 'sheet1' exist??
 
B

Bob Phillips

Is t7:T64 all numeric, or is there some text in there?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

solo said:
I have a sub that looks like the one below but it gives me an error when I
try to run it, it compiles fine and I cannot seem to know whats wrong.
 
S

solo

Thank you guys for your replies but the problem was that I declared it as a Range and was trying to "=" to a Worksheet, big heriarchichal no, no it seems I just took the worksheets part out and it worked fine

Until next question.....
 
Top