Hi everyone,

I'm trying to allow my subroutine to be able to handle a user choosing cancel, but I'm not sure how to write an if statement to do so when the inputbox is formatted as double rather than a string. I've tried using both "" or 0 to indicate cancel, but neither works. each time I get a type mismatch error. Any thoughts?

GasGravity = InputBox("prompt", "title", 0#)
If (GasGravity = 0#) Then
MsgBox "Please input a specific gravity to proceed", vbOKOnly, "Error"
GasGravity = InputBox("What Gas Gravity would you like to use?", "Gas Gravity", 0#)
ElseIf (GasGravity = "") Then
MsgBox ("User Has Cancelled")
Exit Sub
End If

I know this is probably simple, I'm very new at this. Thanks for your help!