Here's a quick tip about declaring variables in-line which has been known to catch out even some seasoned devs.
Declaring variables in-line is a great way to logically group variables and save space by putting them all on the same line:
Dim wsMain, wsData, wsArchive As Worksheet
Great, we've got a bunch of worksheets declared. Well, actually in this case we don't... what we have there is one worksheet - wsArchive - the rest are variants. You can check this by inspecting them in the watch window:
So why is this happening? Simply put, the compiler only recognises a data type if the variable is immediately suffixed by the type. In the above example wsArchive is the only variable immediately followed by a type, Worksheet. Because the compiler doesn't know what to do with the other variables it creates them in the variant type. In case you're wondering, using the Option Explicit statement won't help you identify such an error as we can freely assign a worksheet to a variant provided we use the Set keyword.
So, in short; it's OK to assign in-line but make sure you specify the type every time.
Dim wsMain As Worksheet, wsData As Worksheet, wsArchive as worksheet
That way you'll always be using the correct variable type.