Public Function basInch2FtIn(InchIn As Single) As Variant()
Dim MyFt As Integer
Dim MyIn As Single
Dim MyFractIn As Single
Dim MyVar(2) As Variant
MyFt = InchIn / 12
MyIn = InchIn - (12 * MyFt)
MyFractIn = MyIn - Int(MyIn)
MyVar(0) = MyFt
MyVar(1) = MyIn
MyVar(2) = MyFractIn
'To Return a SINGLE string formatted as feet and Inches (w/ decimal fractions _
of the inches, use this return and change hte return Type to String
'Example Usage for THIS return:
'? basInch2FtIn(147.5)
'12Ft, 3.5In
' basInch2FtIn = Trim(Str(MyFt) & "Ft") & ", " & Trim(Str(Int(MyIn) + MyFractIn) & "In")
'To Return the elements of the conversion in an array, use this return _
with the return type as a variant Array (e.g. "As Variant()")
basInch2FtIn = MyVar
End Function
Public Function basTestFtIn(In2Test As Single)
'Michael Red 12/18/2002
'To ILLUSTRATE the conversion of Feet to Inches as an array of Feet, Inches and _
and fractions of an inch
'? basTestFtIn(147.5)
'12
'3.5
'0.5
Dim MyAry() As Variant
Dim Idx As Integer
MyAry = basInch2FtIn(In2Test)
Idx = 0
While Idx <= UBound(MyAry)
Debug.Print MyAry(Idx)
Idx = Idx + 1
Wend
End Function
[code]
MichaelRed
m.red@att.net
Searching for employment in all the wrong places