Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Determining biggest variable
Hello!
Is there a convenient way to check in VBA, which of my 5 Long-type variables is biggest? -TK |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Location of a the second biggest number in a range | Excel Worksheet Functions | |||
Biggest Loser Formula | Excel Discussion (Misc queries) | |||
Variable determining formula | Excel Discussion (Misc queries) | |||
Finding a name with biggest number | Excel Worksheet Functions |