Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Determining biggest variable

Hello!

Is there a convenient way to check in VBA, which of my 5 Long-type variables
is biggest?


-TK


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default Determining biggest variable

Hi TK,

Yes, you can use the built-in worksheet function MAX from VBA:

Sub test()
Dim l1 As Long
Dim l2 As Long
Dim l3 As Long

l1 = 1
l2 = 2
l3 = 3

MsgBox Application.WorksheetFunction.Max(l1, l2, l3)
End Sub

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


Tommi wrote:
Hello!

Is there a convenient way to check in VBA, which of my 5 Long-type
variables is biggest?


-TK

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Determining biggest variable

Thanks Jake!

"Jake Marx" wrote in message
...
Hi TK,

Yes, you can use the built-in worksheet function MAX from VBA:

Sub test()
Dim l1 As Long
Dim l2 As Long
Dim l3 As Long

l1 = 1
l2 = 2
l3 = 3

MsgBox Application.WorksheetFunction.Max(l1, l2, l3)
End Sub

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


Tommi wrote:
Hello!

Is there a convenient way to check in VBA, which of my 5 Long-type
variables is biggest?


-TK



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
Location of a the second biggest number in a range Josh G Excel Worksheet Functions 5 August 31st 09 10:21 PM
Biggest Loser Formula JSR929 Excel Discussion (Misc queries) 8 January 22nd 08 07:40 PM
Variable determining formula natelr Excel Discussion (Misc queries) 2 June 28th 06 12:27 AM
Finding a name with biggest number Handyy Excel Worksheet Functions 11 February 6th 06 12:06 PM


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