Help w/ Vlookup VBA

BIGTONE559

Active Member
Joined
Apr 20, 2011
Messages
336
Good Morning.

I seem to be having issues with the syntax using the vlookup formula.

the code is as follows:

Code:
Sub Avlookup_Test()

Dim x As Integer
Dim y As Integer
Dim z As Variant

x = 6





Do Until x = 25




If Application.WorksheetFunction.VLookup(Range(Cells(x, 4)), Range("checklist"), 2, False) = Cells(x, 2) Then



MsgBox ("This Value is Correct")





Else
MsgBox ("This value is incorrect")

End If

x = x + 1



Loop


End Sub
The code is supposed to check values on the current sheet with a range on another sheet.

Any help is appreciated.
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Forgot to put that i'm receiving

Runtime error 1004
Method 'Range' of object'_Global' failed

when i attempt to run the macro
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,728
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top