Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Return Max Value of given Variables

I have ten variables in my code, and I need to return which variable is the
highest, and what its name is.

Any help is greatly appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Return Max Value of given Variables

You would have to compare one against the other. You could use an array
instead and use the worksheet MAX function on it.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Keenan Hansen" <Keenan wrote in message
...
I have ten variables in my code, and I need to return which variable is the
highest, and what its name is.

Any help is greatly appreciated.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Return Max Value of given Variables

I'm currently sending the variable values to the sheet and then comparing any
irregularities against the set's Mode. I would rather have this run in the
code and not be present in any of the sheet's real estate.

i.e.
x=2
y=2
z=3
Dim Greatest as String
Greatest = 'code returns "z" as greatest value
msgbox (Greatest) & "is the greatest variable",0,"Variable Info"


"Bob Phillips" wrote:

You would have to compare one against the other. You could use an array
instead and use the worksheet MAX function on it.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Keenan Hansen" <Keenan wrote in message
...
I have ten variables in my code, and I need to return which variable is the
highest, and what its name is.

Any help is greatly appreciated.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Return Max Value of given Variables

So, are you going to test one against another or use an array?

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Keenan Hansen" wrote in message
...
I'm currently sending the variable values to the sheet and then comparing
any
irregularities against the set's Mode. I would rather have this run in
the
code and not be present in any of the sheet's real estate.

i.e.
x=2
y=2
z=3
Dim Greatest as String
Greatest = 'code returns "z" as greatest value
msgbox (Greatest) & "is the greatest variable",0,"Variable Info"


"Bob Phillips" wrote:

You would have to compare one against the other. You could use an array
instead and use the worksheet MAX function on it.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"Keenan Hansen" <Keenan wrote in
message
...
I have ten variables in my code, and I need to return which variable is
the
highest, and what its name is.

Any help is greatly appreciated.






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Return Max Value of given Variables

I guess I could write a fairly long set of logical tests, but I was wondering
if there is a quicker way.

"Bob Phillips" wrote:

So, are you going to test one against another or use an array?

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Keenan Hansen" wrote in message
...
I'm currently sending the variable values to the sheet and then comparing
any
irregularities against the set's Mode. I would rather have this run in
the
code and not be present in any of the sheet's real estate.

i.e.
x=2
y=2
z=3
Dim Greatest as String
Greatest = 'code returns "z" as greatest value
msgbox (Greatest) & "is the greatest variable",0,"Variable Info"


"Bob Phillips" wrote:

You would have to compare one against the other. You could use an array
instead and use the worksheet MAX function on it.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"Keenan Hansen" <Keenan wrote in
message
...
I have ten variables in my code, and I need to return which variable is
the
highest, and what its name is.

Any help is greatly appreciated.






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
Multiple variables to sort and sum, return values<0 with sum refer Stinky Excel Worksheet Functions 5 April 20th 10 04:18 PM
Lookup function for two variables and return another cell? dcw0405 Excel Worksheet Functions 2 February 4th 10 05:23 PM
Lookup based on two variables and return a third Mark Excel Worksheet Functions 3 August 29th 08 03:26 PM
return 2 or more variables from a function David Adamson[_4_] Excel Programming 3 November 18th 05 05:12 AM
2 Conditions True, Many Variables, Return Result elliekev26 Excel Worksheet Functions 4 September 22nd 05 04:16 PM


All times are GMT +1. The time now is 06:58 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"