I just double checked and the error does trigger when you press Cancel, so I am not sure what is happening for you.

When you Dim as Range make sure you use the Set statement to assign the Range

i.e.

Dim Rng1 as Range

Set Rng1 = ...

The picture you posted is the error that is built into the Application.Inputbox If you try to input invalid data you get the error. Since a blank "" is not a range you get the error when you leave this empty.

On Error Resume Next tells VBA to ignor errors
On Error Goto 0 tells VBA to reset what it does for errors and start handling them like it normally would.