PDA

View Full Version : Add formula dynamically to different sheets



marcus
07-09-2009, 12:22 PM
Hi

cur = thisworkbook.name

I am trying to insert this formula in another sheet [eg:B]. The VBA code is in another workbook [eg:cur which is user defined]. how do I make this sheet name dynamic?[name in bold in below formula]

ActiveCell.FormulaR1C1 = _
"=IF(ISblank(VLOOKUP(RC2,[cur]order!R2C1:R60C10,column(R4C)-3,0)),"""",VLOOKUP(RC2,[cur]order!R2C1:R60C10,column(R4C)-3,0))"