VBA Vlookup Help

sararose27

New Member
Joined
Aug 20, 2018
Messages
6
I could use some help setting up a vlookup that will be used in multiple cells in the same worksheet. The data is in a different tab in same worksheet.
The lookup value will be cell B5 in the sheet with the vlookup.
Table Array: AE 2019 eCAT Test Ppts ***do I need to remove spaces from tab name?***
Column Index: 13 ***this will change based on the data I need to pull***
Range Lookup: False.

I am hoping to come up with one row of code that I can copy/paste and just change the Column Index.

I tried
Dim EEID As String EEID = Range("B5")
ActiveCell.FormulaR1C1 = _
"=VLOOKUP("EID"'AE 2019 eCAT Test Ppts'!C[5]:C[52],13,0)"

It isn't working.
TIA
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Hello,

Aren't you just missing a comma ... after your value "EID" ... ?

HTH
 
Upvote 0
Hi,

Are you trying to use VBA to do this or
Just using "VLOOKUP" in a range of cells on a worksheet?

If its on a worksheet then your current "VLOOKUP" formula does not like right at all.
 
Upvote 0
Trying to use VBA. I have about 100 rows of data that I need to turn into separate tabs with formatting.
Hi,

Are you trying to use VBA to do this or
Just using "VLOOKUP" in a range of cells on a worksheet?

If its on a worksheet then your current "VLOOKUP" formula does not like right at all.
 
Upvote 0
Re,

If you were to type in the formula directly in cell B5 ....in order to check it is working properly ...

Would you mind posting your formula afterwards ...

By the way ... have you tested :

Code:
[COLOR=#333333][FONT=Verdana]ActiveCell.FormulaR1C1 = _[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]"=VLOOKUP(B5,'AE 2019 eCAT Test Ppts'!C[5]:C[52],13,0)"[/FONT][/COLOR]
 
Last edited:
Upvote 0
Just to also note that "EID" will require double quotes in VBA so it should be ""EID"'".
 
Upvote 0
I ended up with this and it seems to do the job
ActiveCell.FormulaR1C1 = "=VLOOKUP(R5C2,'AE 2019 eCAT Test Ppts'!C7:C54,29,0)"
 
Upvote 0

Forum statistics

Threads
1,214,819
Messages
6,121,746
Members
449,050
Latest member
excelknuckles

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