View Single Post
  #1   Report Post  
nobbyknownowt nobbyknownowt is offline
Member
 
Posts: 57
Default Macro to insert formula

I had a look through the forum but could not find what i need, can anyone out there help?
I have a sheet that works fine and am just fine tuning the last bits and I need a little help please.
There is a function =LOOKUP(K1,'AR7 calcs'!F22:F24,'AR7 calcs'!N22:N24) that as part of the sheet could possibly be overwritten in some circumstances so i want to reinsert it as part of a clear sheet macro I have written.
The macro Range("I13:J13").Select
ActiveCell.FormulaR1C1 = "=LOOKUP(K1,'AR7 calcs'!F22:F24,'AR7 calcs'!N22:N24)" leaves the formula as =LOOKUP('K1','AR7 calcs'!'F22':'F24','AR7 calcs'!'N22':'N24') and retuns a #name? error

How do I get the macro to input exactly the formula I need?

chers
nobby