Trying to use the offset function while having the reference cell be equal to a value that a match function has returned. I am getting an object required error when compiling. I realize that the value of the match function I receive is now equivalent to a 'reference cell' for the offset function but I am unsure of how to convert it into one.

Sub naming()
    Range("A2", Range("A2").End(xlDown)).name = "Names"
End Sub
Sub MatchApplication()
    Dim val As Variant, name As String, x As String
    
    name = InputBox("Enter the name you wish to search for")
   
    val = Application.Match(name, Range("Names"), 0)
    If IsError(val) Then MsgBox "not found"

    val.Offset(0, 1).value = x
    
    MsgBox x
    
End Sub