Marco and VLOOKUP issue

spectraflame

Well-known Member
Joined
Dec 18, 2002
Messages
829
Office Version
  1. 365
Platform
  1. Windows
I have a macro that enters in the following formula.

ActiveCell.FormulaR1C1 = "=VLOOKUP(RC3,WATER_COMMENTS,2,0)"

What is returned in the cell is just =VLOOKUP

Is there a better way of scripting this?

BTW - Using 2010 and the code worked great in 2000 before converting it.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
I know the the standard formula of =VLOOKUP(C2,WATER_COMMENTS,2,0) works if I key it in. It is just when I am trying to use a macro to input it.

I am going to breakdown the full macro into smaller pieces and see if I can determine if there is something else causing the issue.
 
Upvote 0
Try once the simpler version:
ActiveCell = "=VLOOKUP($C3,WATER_COMMENTS,2,0)"

(This too works in 2003)
 
Upvote 0

Forum statistics

Threads
1,203,059
Messages
6,053,301
Members
444,650
Latest member
bookendinSA

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