Manage InputBox method reference entry Exploring the VBA Application.InputBox method I've realized that catching user cancellation is tricky when type is reference, so return value is a range object. 

As cancellation's return value is False I can't assign it to an object with Set, so I've created a UDF to return Nothing when user pressed cancel / Esc.

Function mjInputBox(prompt As String, title As String, default As Variant, dataType As Integer) As Variant

    If dataType = xlInputReference Then
        On Error GoTo InputCancelled
        Set mjInputBox = Application.InputBox(prompt:=prompt, title:=title, default:=default, Type:=dataType)
        On Error GoTo 0
    Else
        mjInputBox = Application.InputBox(prompt:=prompt, title:=title, default:=default, Type:=dataType)
    End If

    Exit Function

InputCancelled:
    Err.Clear
    Set mjInputBox = Nothing
End Function


(xlInputReference is a constant = 8)

Is it a good practice, or can I improve it?


having a one line code instead of the UDF would be a big improvement
According to MSDN:  



  For example, for an input box that can accept both text and numbers,
  set Type to 1 + 2.



Is it possible to combine input types including reference too? (note that I can assign return value of inputBox without set which will combine my reference to a cell value, which isn't acceptable).
I'm not sure where you got xlInputReference from, or 16. According to the MSDN page you linked, the correct type for a reference input is 8. 

I'm not sure I like your approach. You only need this for range inputs. Personally, I would handle this (prompting for range inputs) by asking for a cell reference (as text) then converting that text into a range object separately (with appropriate error handling).

But, to take your current approach:



As it stands, I've got very little that I can see improvements for.  

You shouldn't use Integer. It is completely deprecated. Use Long instead.  

Your method name isn't great and breaks convention (that Metohd names use PascalCase). I would use something like HandleInputBox.

Since yes, you can have compound return types but obviously, trying to return some combination of object + text + number is going to fail, you probably want to check for it:

If dataType Mod 16 &gt;= 8 Then
    If dataType &lt;&gt; 8 Then
    '/ Compound of 8 with other values
        '/ Error handling
    Else
        On Error GoTo InputCancelled
        Set mjInputBox = Application.InputBox(prompt:=prompt, Title:=Title, Default:=Default, Type:=dataType)
        On Error GoTo 0
    End If
Else
    mjInputBox = Application.InputBox(prompt:=prompt, Title:=Title, Default:=Default, Type:=dataType)
End If


You should probably implement all the other optional arguments for Application.InputBox() as well since you only have to pass them through.

Other than that, I have nothing to critique. The code is good.