PC Review


Reply
Thread Tools Rate Thread

How do I assign value of formula to a variable?

 
 
=?Utf-8?B?U25vd3NyaWRl?=
Guest
Posts: n/a
 
      13th Nov 2006
I want to assign the value a formula to a variable. In a sheet named Data I
have range of cells a1:g200 that contain values. I want to assign the
maximum value to myVariable.

I've tried:

myVariable = Max(Range("Data!a1:g200")).Value

but I get an error 'Sub or Function not defined.

Thanks for any help.
 
Reply With Quote
 
 
 
 
Dave Patrick
Guest
Posts: n/a
 
      13th Nov 2006
myVariable = Application.WorksheetFunction.Max(Range("a1:g200"))

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Snowsride" wrote:
|I want to assign the value a formula to a variable. In a sheet named Data
I
| have range of cells a1:g200 that contain values. I want to assign the
| maximum value to myVariable.
|
| I've tried:
|
| myVariable = Max(Range("Data!a1:g200")).Value
|
| but I get an error 'Sub or Function not defined.
|
| Thanks for any help.


 
Reply With Quote
 
=?Utf-8?B?U25vd3NyaWRl?=
Guest
Posts: n/a
 
      13th Nov 2006
Thanks

"Dave Patrick" wrote:

> myVariable = Application.WorksheetFunction.Max(Range("a1:g200"))
>
> --
>
> Regards,
>
> Dave Patrick ....Please no email replies - reply in newsgroup.
> Microsoft Certified Professional
> Microsoft MVP [Windows]
> http://www.microsoft.com/protect
>
> "Snowsride" wrote:
> |I want to assign the value a formula to a variable. In a sheet named Data
> I
> | have range of cells a1:g200 that contain values. I want to assign the
> | maximum value to myVariable.
> |
> | I've tried:
> |
> | myVariable = Max(Range("Data!a1:g200")).Value
> |
> | but I get an error 'Sub or Function not defined.
> |
> | Thanks for any help.
>
>
>

 
Reply With Quote
 
Dave Patrick
Guest
Posts: n/a
 
      13th Nov 2006
You're welcome.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Snowsride" wrote:
| Thanks


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Assign JavaScript variable to Jsp Variable Ranjan Microsoft ASP .NET 1 10th Apr 2007 04:35 PM
How to assign the value of the java script variable to a server side variable in C# code behind code? ravindravarman@gmail.com Microsoft Dot NET 1 5th Apr 2007 04:04 PM
How to assign the value of the java script variable to a server side variable in C# code behind code? ravindravarman@gmail.com Microsoft Dot NET 0 5th Apr 2007 07:58 AM
Change cell formula & assign to VBA variable... Kevin Lyons Microsoft Excel Programming 0 5th Feb 2005 06:58 AM
Assign Formula to Variable =?Utf-8?B?SmFtZXMgU3RlcGhlbnM=?= Microsoft Excel Programming 3 26th Feb 2004 04:16 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:44 AM.