I am a long time avid Excel user but am just starting to learn VBA. I am using the following code but am getting an error when I try to run Sub test
:
Compile Error:Variable not defined
Can you help me figure out what is wrong?
Option Explicit
Function toFarenheit(degrees)
toFarenheit = (9 / 5) * degrees + 32
End Function
Function toCentigrade(degrees)
toCentigrade = (5 / 9) * degrees - 32
End Function
Sub test()
answer = toCentigrade(55)
MsgBox answer
End Sub