Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.
Public Function jzTINV(intProb As Double, intFree As Double) As Double ' Calculates the Inverse T-Distribution using a work around. As the formula TINV is not in Visual Basic, ' and it is quite complex mathematics, i have created this work around. ' It is a little slow, but works (around 5 to 10 calcs a sec, depending on computer) Dim intOut As Double Dim objExcel As Object Dim objWorkbook As Object Dim objWorksheet As Object Set objExcel = CreateObject("Excel.Application") objExcel.Visible = False Set objWorkbook = objExcel.Workbooks.Add() Set objWorksheet = objWorkbook.Worksheets(1) objWorksheet.Activate objExcel.cells(1, 2) = intProb objExcel.cells(1, 3) = intFree objExcel.cells(1, 1) = "=TINV(b1,c1)" intOut = objExcel.cells(1, 1).Value jzTINV = intOut objWorkbook.Close False objExcel.Quit End Function
Join the community of 500,000 technology professionals and ask your questions.