Getting the value of .FormulaR1C1 help please

jecruz

New Member
Joined
Sep 27, 2011
Messages
9
Hi Everyone,

My question is about this:

Code:
ActiveSheet.Cells(i, 106).FormulaR1C1 = _
        "=VLOOKUP(RC[-4],'[Lookup Reference.xls]Sheet1'!R2C1:R11C2,2,FALSE)"

The output in excel is the formula itself. How can it be just the value retrieved from the lookup? I guess what I need is the syntax for vba.

Thanks a lot in advance. :D
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Can you tell what does vlookup formula look like without R1C1 reference?

Biz
 
Upvote 0
Code:
=VLOOKUP(CX2,'[Lookup Reference.xls]Sheet1'!$A$2:$B$11,2,FALSE)

But i need this formula for rows 2 to 43071 thus the R1C1 reference.

Thanks.
 
Upvote 0
Try this

Code:
Sub Test()
Range("DB2:DB43071").Formula = "=VLOOKUP(CX2,'[Lookup Reference.xls]Sheet1'!$A$2:$B$11,2,FALSE)"
End Sub

Does it help?

Biz
 
Upvote 0
Code:
With Range("DB2:DB43071")
    .FormulaR1C1 = "=VLOOKUP(RC[-4],'[Lookup Reference.xls]Sheet1'!R2C1:R11C2,2,FALSE)"
    .Value = .Value
End With
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,314
Members
452,634
Latest member
cpostell

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