I have a separate module to declare public variables
Public ws1, ws2 As Worksheet
On each module, on each procedure I must repeat the following :
Set ws1 = Sheets("Sun")
Set ws2 = Sheets("Moon")
…and then – write the code.
So, WHERE and HOW can I Set this variables so they are allready set on each module, on each Sub or Function – as Sheets Sun and Moon ?
Once you have it set it will remain available to the other modules. So I suggest you set it on
Workbook_Open. Also your current code does not dimensionws1as a worksheet, so I suggest you useStandard ModuleThisWorkbook Module