I am importing values from an excel spreadsheet after running regression analysis. I bring the numbers over using the code below. However, the numbers come in and automatically round to the nearest whole number. I need them out to the second decimal point. I have tried using "general number" and "fixed", both with 2 decimal places. General number doesn't do anything and fixed just puts in x.00. Can anyone help with this issue?
Thanks again!
Private Sub Command279_Click()
Dim xl As Object
Dim xlWrkBk As Object
Dim xlSht As Object
Set xl = CreateObject("Excel.Application")
xl.Visible = True
Set xlWrkBk = xl.Workbooks.Open("I:\My Offers\" & Job_Code & "_Regression.xls")
Set xlSht = xlWrkBk.Worksheets(1)
[C1] = xlSht.cells(18, 2)
[C2] = xlSht.cells(19, 2)
[C3] = xlSht.cells(20, 2)
[C4] = xlSht.cells(21, 2)
[Y-Intercept] = xlSht.cells(17, 2)
[Multiple_R] = xlSht.cells(4, 2)
[R_Squared] = xlSht.cells(5, 2)
[F_Value] = xlSht.cells(12, 5)
[Sig_F] = xlSht.cells(12, 6)
[Observations] = xlSht.cells(8, 2)
xlWrkBk.Close False
xl.Quit 'Close Excel
Set xlSht = Nothing
Set xlWrkBk = Nothing
Set xl = Nothing
End Sub
Thanks again!
Private Sub Command279_Click()
Dim xl As Object
Dim xlWrkBk As Object
Dim xlSht As Object
Set xl = CreateObject("Excel.Application")
xl.Visible = True
Set xlWrkBk = xl.Workbooks.Open("I:\My Offers\" & Job_Code & "_Regression.xls")
Set xlSht = xlWrkBk.Worksheets(1)
[C1] = xlSht.cells(18, 2)
[C2] = xlSht.cells(19, 2)
[C3] = xlSht.cells(20, 2)
[C4] = xlSht.cells(21, 2)
[Y-Intercept] = xlSht.cells(17, 2)
[Multiple_R] = xlSht.cells(4, 2)
[R_Squared] = xlSht.cells(5, 2)
[F_Value] = xlSht.cells(12, 5)
[Sig_F] = xlSht.cells(12, 6)
[Observations] = xlSht.cells(8, 2)
xlWrkBk.Close False
xl.Quit 'Close Excel
Set xlSht = Nothing
Set xlWrkBk = Nothing
Set xl = Nothing
End Sub