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?
 

Some videos you may like

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

RSXchin

Well-known Member
Joined
Oct 23, 2010
Messages
758
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.
 

pedie

Well-known Member
Joined
Apr 28, 2010
Messages
3,875
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]
 

Watch MrExcel Video

Forum statistics

Threads
1,108,805
Messages
5,524,979
Members
409,613
Latest member
Dalex100

This Week's Hot Topics

Top