Functionally for my purposes...Awesome
A lot better than the variable array, that was getting rather complex because I decided on adding a line of boxes at a time rather than 10 rows at once as maximum.
Thanks a million Sisyphus.
This forum has been moved to TeachExcel.com
Ask all future questions in the New Excel Forum.
ExcelKey
Public Function FractionToDecimal(ByVal Num As String) As Variant
Dim Fd As Variant
Dim S() As String
Dim T() As String
Dim Dn As Double
S = Split(Num)
If LBound(S) = UBound(S) Then
T = Split(Num, "/")
If LBound(T) = UBound(T) Then
Fd = Num
Else
Fd = T(LBound(T)) / T(UBound(T))
End If
Else
Fd = Val(S(LBound(S)))
S = Split(S(UBound(S)), "/")
If UBound(S) > LBound(S) Then
Dn = Val(S(UBound(S)))
If Dn = 0 Then Dn = 1
Fd = Val(S(LBound(S))) / Dn * Sgn(Fd) + Fd
End If
End If
FractionToDecimal = Fd
End Function
Return to Macros and VBA Questions
Users browsing this forum: No registered users and 13 guests