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

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
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,214,403
Messages
6,119,308
Members
448,886
Latest member
GBCTeacher

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