Runtime Error 91 : Object Variable Or With Block Variable Not Set

MCE2014

New Member
Joined
Sep 15, 2014
Messages
21
Hi Im getting "Runtime Error 91 : Object Variable Or With Block Variable Not Set" from the following line of code.

Im relatively new to programming/VBA and i need help to find out what im doing wrong here:

r = Application.VLookup(Plant_No, Range("F2:F63"), i, False)
 

Some videos you may like

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
17,206
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Hi Im getting "Runtime Error 91 : Object Variable Or With Block Variable Not Set" from the following line of code.

Im relatively new to programming/VBA and i need help to find out what im doing wrong here:

r = Application.VLookup(Plant_No, Range("F2:F63"), i, False)
Can you post enough of your code to allow us to see how the variables in bold red are dimensioned and initialized? Also, seems a bit strange to have a single column be the lookup range - is there a typo there?
 

Watch MrExcel Video

Forum statistics

Threads
1,108,960
Messages
5,525,911
Members
409,671
Latest member
nasseralateek

This Week's Hot Topics

Top