Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Max WorksheetFunction

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Max WorksheetFunction

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

--
Regards
Frank Kabel
Frankfurt, Germany

solo wrote:
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 Variant
VarMaxVal = 0
Dim myRange As Range

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

End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Max WorksheetFunction

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" wrote in message
...
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 Variant
VarMaxVal = 0
Dim myRange As Range

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

End Sub



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Max WorksheetFunction

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.....
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Max WorksheetFunction

procedure works fine with me, even with text in the given range


"Bob Phillips" schreef in bericht
...
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" wrote in message
...
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 Variant
VarMaxVal = 0
Dim myRange As Range

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

End Sub





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
WorksheetFunction help Ayo Excel Discussion (Misc queries) 2 July 20th 08 10:48 PM
Can't use WorksheetFunction Yossi Excel Discussion (Misc queries) 5 January 25th 06 10:07 PM
WorkSheetFunction.CountIf & WorkSheetFunction.SumIf with 2 conditions? Etien[_2_] Excel Programming 3 January 13th 04 04:07 PM
WorksheetFunction Stuart[_10_] Excel Programming 3 November 13th 03 12:33 AM
worksheetfunction devnext Excel Programming 1 October 29th 03 12:48 PM


All times are GMT +1. The time now is 02:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"