Eric Penfold
Active Member
- Joined
- Nov 19, 2021
- Messages
- 431
- Office Version
- 365
- Platform
- Windows
- Mobile
Trying to use the VLookup with Listbox Value but it keeps saying error 1004. I`ve checked all the rest of the code and it`s fine??
VBA Code:
Sub MatchEmail()
Dim wb As Workbook
Dim ws As Worksheet
Dim LRow As Long
Dim Rng As Range
Set wb = Workbooks("Personal.xlsb")
Set ws = wb.Worksheets("Emails")
Set Rng = ws.Range("A1").CurrentRegion
LRow = ws.Cells(Rows.Count, 1).End(xlUp).Row
Me.EmailAddress.Value = Application.WorksheetFunction.VLookup(Me.SuppliersName.Value, ws.Range("A2:B" & LRow), 2)
Call Emails
End Sub