Invalid Outside procedure means you pasted the "snippet" above into a module somewhere that is not between SUB/END SUB headers and footers.
How to address specific sheetnames is "design" decision. If a group of sheets are referenced off and on all through the lines of code to follow should, I pay be tempted to declare sheet variables at the top of the macro, then refer them all through the code by the variable object. This makes it easy to change those sheet names later in one place at the top and those new sheet names flow down into the code with no additional edits.
Another trick is to mention a sheet once then let a bunch of lines of code that follow all link to that sheet by using leading "dots" on those lines of code. This again allows the sheet names to edited in fewer places if ever need be:
Bookmarks