Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ed Ed is offline
external usenet poster
 
Posts: 46
Default Assigning a min to a variable

I have trouble assigning the min value of a rangein a macro to a
variable say "m".

I tried:

l=min(Range("D4:D7")

and get the message:

" Compile error
Sub or function not defined"

How can I correct the error?


Thanks,


Ed
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Assigning a min to a variable

l=Application.min(Range("D4:D7")


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Ed" wrote in message
...
I have trouble assigning the min value of a rangein a macro to a
variable say "m".

I tried:

l=min(Range("D4:D7")

and get the message:

" Compile error
Sub or function not defined"

How can I correct the error?


Thanks,


Ed



  #3   Report Post  
Posted to microsoft.public.excel.programming
Ed Ed is offline
external usenet poster
 
Posts: 46
Default Assigning a min to a variable

That did it. Thank you.

ed English




On Thu, 3 Aug 2006 16:54:08 +0100, "Bob Phillips"
wrote:

l=Application.min(Range("D4:D7")

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Assigning a min to a variable

VBA doesn't have a min function, so use the worksheet equivalent
l=WorksheetFunction.min(Range("D4:D7")

--
Regards,
Tom Ogilvy


"Ed" wrote:

I have trouble assigning the min value of a rangein a macro to a
variable say "m".

I tried:

l=min(Range("D4:D7")

and get the message:

" Compile error
Sub or function not defined"

How can I correct the error?


Thanks,


Ed

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
Assigning values to a variable set John A[_2_] Excel Discussion (Misc queries) 1 April 23rd 10 08:20 PM
Assigning a variable Zack Excel Worksheet Functions 3 December 11th 08 07:00 PM
Assigning a variable a value from a Cell in VBA [email protected] Excel Programming 3 February 15th 06 06:26 PM
Assigning a row to a variable Todd Excel Programming 4 June 10th 04 06:49 PM
Re-assigning the value of a variable for a for loop from Mike Berry Excel Programming 1 July 16th 03 02:41 PM


All times are GMT +1. The time now is 12:33 AM.

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

About Us

"It's about Microsoft Excel"