Dynamic VlookUp

pjkaphlen

Board Regular
Joined
Aug 3, 2015
Messages
85
Office Version
  1. 365
  2. 2013
Platform
  1. Windows
I am trying to vlookup a dynamic Column. here's my current code:

Code:
Range(s3 & FirstCol).Formula = "=VLOOKUP(" & nge & ",'[" & Range("D1").Value & "]Pivot Data'!R1C2:R65535C11,10,0)"

with

Dim nge as String
nge = "A3:A"

However the result from excel (after running the code) is :

Code:
=VLOOKUP([B][COLOR=#ff0000]'A3':A[/COLOR][/B],'[Input WS# here-Historic_Price_Check-111715.xls]Pivot Data'!$B$1:$K$65535,10,0)"

=#NAME?

Normally, vba shows this as RC[xx] however I cannot use RC since the position of my lookup cell is dynamic.

Anybody who can help me this is simple prob?
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Forum statistics

Threads
1,213,504
Messages
6,114,016
Members
448,543
Latest member
MartinLarkin

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