Hi all,

I have a macro that I want to use to update username and password.
All is well until I get to the application.vlookup part of the code, and it tells me an object is needed.

I have messed with this until my eyes are bleeding. Any help would be tremendous, thanks!

Windows 7, Excel 2010

Sub UpdatePassword_Click()

Dim CurrentUsername As Integer, CurrentPassword As Integer
Dim Result1 As String, Result2 As String

CurrentUsername = Range("O11").Value
CurrentPassword = Range("O18").Value

If Range("J16") = Range("N16") Then
   Result2 = Range("J15").Value
   
End If

If Range("J23") = Range("N23") Then
   Result2 = Range("J22").Value

Application.VLookup(CurrentUsername, User_Login_Database.Range("D:H"), 4, False) = Result1
Application.VLookup(CurrentPassword, User_Login_Database.Range("D:H"), 5, False) = Result2

End If

End Sub