Public Sub Set1stIfNeg2ndIfPos( _
ByVal vExpr As Variant _
, ByRef rSetIfNeg As Variant _
, ByRef rSetIfPos As Variant _
) Assuming
Dim varNeg As Variant
Dim varPos As Variant
for example
Set1stIfNeg2ndIsPos 45, varNeg, varPos
leaves
varNeg = 0
varPos = 45
Also
Set1stIfNeg2ndIsPos -45, varNeg, varPos
leaves
varNeg = 45
varPos = 0See also: FixUpVariantToRange SubroutinevExpr: The number whose absolute value is assigned to one of the two other arguments, depending upon whether this number is positive or negative. Subroutine silently does nothing if vExpr is Null or cannot be fixed up to a number.
Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.