Seba Robles
Board Regular
- Joined
- May 16, 2018
- Messages
- 71
- Office Version
- 2019
- 2016
- Platform
- Windows
Hello,
I'm trying to set a variable in my code with a vlookup within a sheet. I get a runtime error 424 "object required" when it gets to the last line in the code below:
Any help is greatly appreciated!
I'm trying to set a variable in my code with a vlookup within a sheet. I get a runtime error 424 "object required" when it gets to the last line in the code below:
VBA Code:
Dim wsFunc As WorksheetFunction
Set wsFunc = Application.WorksheetFunction
Dim ws As Worksheet
Set ws = Sheets("Parameters")
Dim rngLook As Range
Set rngLook = ws.Range("C:E")
Dim GreetName As Range
Dim MailTo As String
MailTo = Sheets("Email").Cells(6,8)
Set GreetName = wsFunc.VLookup(MailTo, rngLook, 3, False)
Any help is greatly appreciated!