I cannot get the decimal places from the following sub to display in
the cell:
Sub proCalcHalfLife()
'sets vars
Dim sglKel As Single
Dim sglHalfLife As Single
Dim vAnswer As String
Dim strHalfLife As String
'pulls vars from worksheet
sglKel = ActiveSheet.Cells(27, 2)
'calc t1/2
sglHalfLife = 0.693 / sglKel
'insert into worksheet
ActiveSheet.Cells(27, 8) = sglHalfLife
'show msg box with half-life
strHalfLife = sglHalfLife
vAnswer = MsgBox(Prompt:="The half-life is " & strHalfLife & "
hrs." _
, Buttons:=vbOKOnly, Title:="Half-Life")
'next sub
Load frmStartDose
frmStartDose.Show
End Sub
The message box displays the answer with decimal places, but the
value inserted into the cell shows as a whole number. The value in
the formula bar shows the number with 6 or 7 decimal places. No
matter what I've tried to change the formatting of the cell, it won't
display them. I have other cells that are displaying them properly,
but this one won't. Any ideas?