I am new to variables and I am having trouble naming the correct types to work with the formulas that I am making.
My code is as follow:
Can anyone tell me the correct data types to use so that I do not get the overflow message?
My code is as follow:
Code:
Sub HMG_Value()
Dim varAverage As Variant 'Average
Dim varAveDev As Variant 'Average Deviation
Dim dbHMG As Double 'Homogeneity %
varAveDev = Range("C61").Value
varAverage = Range("C62").Value
dbHMG = (1 - (varAveDev / varAverage)) * 100
Range("C52").Value = Format(dbHMG, "000.00")
MsgBox "The Homogeneity of the Batch Model before Redistribution is:" & vbCrLf & vbCrLf & _
" " & Format(dbHMG / 100, ".00%"), vbOKOnly, "Homogeneity Results"
End Sub
Can anyone tell me the correct data types to use so that I do not get the overflow message?
Last edited by a moderator: