Activecell formular1c1 define with variables

Benic

New Member
Joined
Aug 2, 2013
Messages
35
Hello,

I have formula that works:

ActiveCell.FormulaR1C1 = "=FuzzyVLookup(RC[-1],'[File.xlsm]Sheet1'!R1C1:R200C2,2,,,3)"

I would like to use variable instead of RC[-1], how can I do it?

thanks
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
what value are you looking to replace the RC[-1]?
 
Upvote 0
For ROW value is always the same = 1,
for COLUMN I would like to select from TextBox - from A to M,

thanks
 
Upvote 0
I use it like this:

ActiveSheet.Range(Kolona2 & Raspon1).Select

ActiveCell.FormulaR1C1 = "=FuzzyVLookup(RC[-1],'[BAZA_USPOREDBA.xlsm]BAZA_KOMPLET'!R1C1:R200C2,2,,,3)"

I have an issue with RC[-1], can I somehow instead of it put something like:

ActiveSheet.Range(Kolona2 & Raspon1).Offset(0,-1) and instead of -1 use variable?

thanks
 
Upvote 0
I have made it work,

Instead of:

ActiveCell.FormulaR1C1 = "=FuzzyVLookup(RC[-1],'[BAZA_USPOREDBA.xlsm]BAZA_KOMPLET'!R1C1:R200C2,2,,,3)"

This works:

ActiveCell.Formula = "=FuzzyVLookup(" & Kol & "" & Rasp & ",'[BAZA_USPOREDBA.xlsm]BAZA_KOMPLET'!A1:B200,2,,,3)"


regards
 
Last edited:
Upvote 0

Forum statistics

Threads
1,213,482
Messages
6,113,916
Members
448,533
Latest member
thietbibeboiwasaco

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