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)"
ActiveCell.FormulaR1C1 =_
"=VLOOKUP (RC[-22],'[" & Shrin_FileName & "]TL and AM Wise'!C1:C4,4,0)"
3 Replies
- Logaraj SekarIron 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 SharmaCopper ContributorHi 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)"
- Bhaskar SharmaCopper Contributor