I have a sub in an Excel 2003 workbook that creates a new worksheet with the click of a button. I copy a template sheet, add data from the new sheet to a sheet ("Totalt") that calculates some totals across all sheets so far, and finally add references to the latest totals on the new sheet. Everything works except for the last part.
When the following bolded line executes I get run-time error 1004:
The strange thing is that it works if I paste the generated formula (eg. "=LOOKUP("Vecka25";Totalt!$B$7:$B$24;Totalt!$F$7:$F$24)") into the sheet manually or set the value to a dummy value like "=1+2+3". Any ideas what might cause this?
edit: SummaryOrigin is a one-cell Range on the top left of the summary section on the new sheet (the length of the data section of the sheet varies).
Bookmarks