View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Celia Celia is offline
external usenet poster
 
Posts: 19
Default in a macro how to make a part of the formula a variable

I am trying to copy a cell from one file into another file in a macro. There
are hundreds of files all linking to the same cell so I thought I would set
the formula up so that is has a variable for the filename but I can't figure
out the syntax. The formula should link to cell $r$16 in worksheet
"monthly" in the changing file name and the variable I used for the
changing file name is budget_file. The following didn't work. Can someone
tell me how to do this?


ActiveCell.FormulaR1C1 = "=" & budget_file & 'monthly'!$r$16"

--
Celia