I have a simple Sub() to pass the current selected cell/s as range to another function but I'm getting an Error 424: Object required when I run the sub.
I already checked SO and saw other Error 424 posts but all are of a different case than mine.
Code:
Public Sub ShowRemoveLicTypModal()
Dim MsgBoxInput As Integer
'Show confirmation for removing license types
MsgBoxInput = MsgBox("Would you like to remove the selected license types?", _
vbYesNo)
Select Case MsgBoxInput
Case vbYes
RemoveLicenseTypeFromList (Selection) '==Error 424 encountered on this line
ThisWorkbook.Save
Case vbNo
End Select
End Sub
The line RemoveLicenseTypeFromList (Selection) where I'm getting the error. It calls the function below. I've already removed all the code from this function for debugging but I'm still getting the error.
Private Function RemoveLicenseTypeFromList(InputRange As Range)
'Nothing here
End Function
I've already tried the following:
Public Sub ShowRemoveLicTypModal()
Dim MsgBoxInput As Integer
Dim Temp As Range
Set Temp = Selection
'Show confirmation for removing license types
MsgBoxInput = MsgBox("Would you like to remove the selected license types?", _
vbYesNo)
Select Case MsgBoxInput
Case vbYes
RemoveLicenseTypeFromList (Temp)
ThisWorkbook.Save
Case vbNo
End Select
End Sub
Selection / Range being passed to RemoveLicenseTypeFromList and I can see that the type is Object/Range OR (Range/Range) for Temp so the types should be matching.
Questions:
What could possibly be causing this error and how do I fix it?
My selection:
Cell A13 shown highlighted on the image. I also tried changing selection all with similar results.

RemoveLicenseTypeFromList temp- Nathan_SavRemoveLicenseTypeFromList(Selection)VBA will insert a space before the bracket, indicating that it isn't required. - Variatus