View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
franciz franciz is offline
external usenet poster
 
Posts: 79
Default Input formula into a column via macro

Hi Tim

There is an error upon running the code. Error message : Run Time Error "1004"
and this is highlighted : Range("P2").Formula = f

thanks

regards, francis

"Tim Zych" wrote:

Dim f As String
f =
"=INDEX([FXAppl.xls]Sheet1!$C$1:$C$100,MATCH(LEFT(Sheet3!A1,4)&""*"",[FXAppl.xls]Sheet1!$B$1:$B$100,0))"
Range("P1").Formula = f

Then if you want to copy it:

Range("P1").Copy
Range("P2:P1000").PasteSpecial xlPasteFormulas
Application.CutCopyMode = False

--
Tim Zych
www.higherdata.com
Compare data in workbooks and find differences with Workbook Compare
A free, powerful, flexible Excel utility


"franciz" wrote in message
...
Hi

How can I input this formula into col P via a macro

=INDEX([FXAppl.xls]Sheet1!$C$1:$C$100,MATCH(LEFT(Sheet3!A1,4)&"*",[FXAppl.xls]Sheet1!$B$1:$B$100,0))

thanks

regards, francis