I'm experimenting with VBA and I've been able to add data to a DB on Sheet 2 .
And now I've tried to show the data on sheet 1 where I choose the ID and it shows the data inserted there, but it gives me an error.
Sub Busca()
Dim valor As Integer
valor = InputBox("Numero:", "buscar")
Range("C24") = valor
Range("C28") = Application.WorksheetFunction.VLookup(valor, Sheets(2).Range("A:B"), 2, False)
End Sub
The error I have is
Run time error 1004
Unable to get the VLookup property of the WorksheetFunction class
This function has worked before, but now gives me error and I do not understand why.