Forum Discussion
Bhaskar Sharma
Apr 08, 2018Copper Contributor
Run-time error '1004': application-defined or object-defined error
Getting error in vba while writing a macro at this statement ActiveCell.FormulaR1C1 =_ "=VLOOKUP (RC[-22],'[" & Shrin_FileName & "]TL and AM Wise'!C1:C4,4,0)"
Logaraj Sekar
Apr 08, 2018Iron Contributor
"=VLOOKUP (RC[-22],'["" & Shrin_FileName & ""]TL and AM Wise'!C1:C4,4,0)"
Try this.
wrote:
Getting error in vba while writing a macro at this statement
ActiveCell.FormulaR1C1 =_
"=VLOOKUP (RC[-22],'[" & Shrin_FileName & "]TL and AM Wise'!C1:C4,4,0)"
wrote:
Getting error in vba while writing a macro at this statement
ActiveCell.FormulaR1C1 =_
"=VLOOKUP (RC[-22],'[" & Shrin_FileName & "]TL and AM Wise'!C1:C4,4,0)"
Bhaskar Sharma
Apr 09, 2018Copper Contributor
Hi Logaraj,
The code worked with " however its not picking the value for the string Shrin_FileName.
ActiveCell.FormulaR1C1 =_
"=VLOOKUP (RC[-22],'["" & Shrin_FileName & ""]TL and AM Wise'!C1:C4,4,0)"
This gives output as
=VLOOKUP (C7,'[ & Shrin_FileName & ]TL and AM Wise'!C1:C4,4,0)"
The code worked with " however its not picking the value for the string Shrin_FileName.
ActiveCell.FormulaR1C1 =_
"=VLOOKUP (RC[-22],'["" & Shrin_FileName & ""]TL and AM Wise'!C1:C4,4,0)"
This gives output as
=VLOOKUP (C7,'[ & Shrin_FileName & ]TL and AM Wise'!C1:C4,4,0)"