I'm trying to learn how to create user functions...did some before but can't find any of my examples...
what i'd like to create is the equivalent of MAX but without using Range in the function...
so essentially if i had 3 numbers i think it would be something like this
i think that's on the right track...but i'm thinking how can i set it up for any number of arguments? and i'm assuming looping through the numbers would be better than IF, THEN, ELSE...so any help on how to clean this up....thanks...
what i'd like to create is the equivalent of MAX but without using Range in the function...
so essentially if i had 3 numbers i think it would be something like this
Code:
Function MAXX(num1, num2, num3) as long
maxx=0
if num1>num2 then maxx=num1
if num2>num3 then
maxx=num2
else
maxx=num3
end if
End Function
i think that's on the right track...but i'm thinking how can i set it up for any number of arguments? and i'm assuming looping through the numbers would be better than IF, THEN, ELSE...so any help on how to clean this up....thanks...