You'd need to move these lines:
to the top of a normal module, outside all procedures, and make the declarations public:Dim WB1 As WorkbookDim SH1 As Worksheet Dim SH2 As Worksheet
but you'd still need to make sure to run the SelectPages code before any other code. You'd be better off just using ThisWorkbook and the sheet code names directly in your code. They work like public variables and you don't need to initialise them.Public WB1 As Workbook Public SH1 As Worksheet Public SH2 As Worksheet