Equation not quite what I was hoping for...

HankJ

Board Regular
Joined
Mar 5, 2016
Messages
89
Hello

I have a formula which is returning me #NAME?

The code is:
Code:
Range("FJ2:FJ" & LR_CompID).FormulaR1C1 = "=VLOOKUP(RC[-2]," & ("FQ" & LR_FP + 1 & ":FR" & LR_FQ) & ",2,FALSE)"

and the formula appears as:
=VLOOKUP(FH2,'FQ13':'FR15',2,FALSE)

Question: how do I paste without the ' either side of the range cells?

Many thanks

Hankj
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
The main issue is that you're mixing the RC and the A1 style of referencing in the same formula. Try using one or the other and see what happens.
 
Upvote 0
The main issue is that you're mixing the RC and the A1 style of referencing in the same formula. Try using one or the other and see what happens.


Hi Eric W

Thanks for that. Sorted.

As an aside, I've always used FormulaR1C1 = to paste in a formula.

Is there a distinction between the types of statements to add different types of formula, RC v A1 styles?

Again thank you

HankJ
 
Upvote 0
There really isn't a difference between the two types, they both evaluate the same. Just depending on how you create the formula, and what the rest of your code looks like, I've found that creating the RC type is a bit easier. But I've done it both ways.

Glad to help.
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,241
Members
452,622
Latest member
Laura_PinksBTHFT

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