Vlookup formula in Macro

GuyCPA

New Member
Joined
May 9, 2007
Messages
37
Hello all,

I'm trying to populate a column with a formula that looks up values from a table in another tab and returns the value from that table.

My macro seems to lock up at the following line:

ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-5].'Aircraft Sales Table'!r[1]c[-7]:r[13]c[-6].2.FALSE)"

What am I doing wrong here?
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
what are you trying to make it do? I'm not sure you need to do the formula action at all.

Post your macro and what you want to make it do please.
 
Upvote 0
Are you not selecting the whole table as range?
or maybe try activecell.value = application.vlookup(lookupvalue,lookuprange,...
Code:
[/FONT]
[FONT=Courier New]ActiveCell.FormulaR1C1 = "=VLOOKUP(R3C8,Table1[#All],2,0)"[/FONT]
[FONT=Courier New]
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,729
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