Trying to use an excel formula in a VBA code. I'm sure I have the syntax wrong. Appreciate the correct way to write it.
A message box comes up and you put a number in it. I want it converted and then variable b to state what it is.
I'm sure I'm falling down with syntax after be =
You can see I'm new at this so appreciate any help.
Dim a As Variant
Dim b As Variant
a = Application.InputBox(prompt:="Type in a number", Title:="Type a Fahrenheit temperature", Default:="Type your temperature here", Type:=1)
b=Application.WorksheetFunction.(Convert(a,"F","C")
MsgBox "Celsius equivalent degrees:" & vbCrLf & Round(b, 1)
A message box comes up and you put a number in it. I want it converted and then variable b to state what it is.
I'm sure I'm falling down with syntax after be =
You can see I'm new at this so appreciate any help.
Dim a As Variant
Dim b As Variant
a = Application.InputBox(prompt:="Type in a number", Title:="Type a Fahrenheit temperature", Default:="Type your temperature here", Type:=1)
b=Application.WorksheetFunction.(Convert(a,"F","C")
MsgBox "Celsius equivalent degrees:" & vbCrLf & Round(b, 1)