Hello,
I have modified the code below to say the sheet code name instead of using the actual sheetname bc actual sheetname is variable. When I run this code it gives me a pop up window? Can anyone tell me how to fix this issue? Thanks
I have modified the code below to say the sheet code name instead of using the actual sheetname bc actual sheetname is variable. When I run this code it gives me a pop up window? Can anyone tell me how to fix this issue? Thanks
Code:
Sub example()
Range("G2").Select
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-6],'Sheet3'!C[-6],1,FALSE)"
Range("H2").Select
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-7],'Sheet4'!C[-7],1,FALSE)"
Range("I2").Select
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-8],'Sheet5'!C[-8],1,FALSE)"
Range("J2").Select
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-9],'Sheet6'!C[-9],1,FALSE)"
Range("K2").Select
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-10],'Sheet2'!C[-9],1,FALSE)"
End Sub