andrea.antorini
New Member
H there,
I am struggling with some piece of VBA code in Excel.
This is the formula in my Excel Sheet:
=SE.ERRORE(CERCA.VERT(B48;'[Pianificazione 2021 dettagliata originale.xlsx]Hausammann'!$B$22:$E$70;2;FALSO);0)
Which has been translated by the (Macro recorder) in the following:
Range("C47").FormulaR1C1 = "=IFERROR(VLOOKUP(RC[-1],'[Pianificazione 2021 dettagliata originale.xlsx]Hausammann'!R22C2:R70C5,2,FALSE),0)"
And it works fine!
Now, here comes the troubles.
In my code I have some declared variables which are myfile and mysheet
Could somebody help me and explain how could I insert these variables in the code?
myfile = Pianificazione 2021 dettagliata originale.xlsx
mysheet = Hausammann
Thanks in advance to any gurus that can solve my problem
Regards Andrea A.
I am struggling with some piece of VBA code in Excel.
This is the formula in my Excel Sheet:
=SE.ERRORE(CERCA.VERT(B48;'[Pianificazione 2021 dettagliata originale.xlsx]Hausammann'!$B$22:$E$70;2;FALSO);0)
Which has been translated by the (Macro recorder) in the following:
Range("C47").FormulaR1C1 = "=IFERROR(VLOOKUP(RC[-1],'[Pianificazione 2021 dettagliata originale.xlsx]Hausammann'!R22C2:R70C5,2,FALSE),0)"
And it works fine!
Now, here comes the troubles.
In my code I have some declared variables which are myfile and mysheet
Could somebody help me and explain how could I insert these variables in the code?
myfile = Pianificazione 2021 dettagliata originale.xlsx
mysheet = Hausammann
Thanks in advance to any gurus that can solve my problem
Regards Andrea A.