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

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

BarryL

Well-known Member
Joined
Jan 20, 2014
Messages
1,436
Office Version
  1. 2019
Platform
  1. Windows
  2. MacOS
what value are you looking to replace the RC[-1]?
 
Upvote 0

Benic

New Member
Joined
Aug 2, 2013
Messages
35
For ROW value is always the same = 1,
for COLUMN I would like to select from TextBox - from A to M,

thanks
 
Upvote 0

Benic

New Member
Joined
Aug 2, 2013
Messages
35
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

Benic

New Member
Joined
Aug 2, 2013
Messages
35
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,195,859
Messages
6,011,989
Members
441,661
Latest member
Pammie007

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
Top