Calling a Sub Procedure
Sub FahrToCels()
	Dim Cels As Double
	Dim Fahr As Double
	
	Fahr = InputBox("Enter the temperature in Fahrenheit", _
					  "Temperature Conversion", "0")
	Cels = 5 * (Fahr - 32) / 9
	
	MsgBox "Conversion from Fahrenheit to Celsius: " & vbCrLf _
		    & CStr(Fahr) & " = " & CStr(Cels), vbOKOnly, _
		    "Temperature Conversion"
End Sub

Private Sub Command5_Click()
	FahrToCels
End Sub
 

Home