Okay, put on your thinking caps. I am entering a formula via VBA containing a reference to another worksheet in the same workbook. Excel, however, seems to think I am looking for a file(?) and starts the 'Open File' dialog box when I run the macro:
UpdatePfmla1 = "=('RC-" & PrevRCNum & "'!CM249 - 'RC-" & PrevRCNum & "'!CG249)"
UpdatePfmla2 = "=('RC-" & PrevRCNum & "'!CM250 - 'RC-" & PrevRCNum & "'!CG250)"
Sheets("RC-" & NextRCNum).Range("CI249"
.Formula = UpdatePfmla1
Sheets("RC-" & NextRCNum).Range("CI250"
.Formula = UpdatePfmla2
The (variable) sheet I am referencing is named RC-xx (where xx is a two-digit number).
Now for the fun part: I am using the very same code elsewhere in this project without a problem... If you have any ideas, please let me know!
UpdatePfmla1 = "=('RC-" & PrevRCNum & "'!CM249 - 'RC-" & PrevRCNum & "'!CG249)"
UpdatePfmla2 = "=('RC-" & PrevRCNum & "'!CM250 - 'RC-" & PrevRCNum & "'!CG250)"
Sheets("RC-" & NextRCNum).Range("CI249"
Sheets("RC-" & NextRCNum).Range("CI250"
The (variable) sheet I am referencing is named RC-xx (where xx is a two-digit number).
Now for the fun part: I am using the very same code elsewhere in this project without a problem... If you have any ideas, please let me know!