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

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.
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,214,556
Messages
6,120,190
Members
448,949
Latest member
keycalinc

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