Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You should establish variables for referencing worksheets in VBA when you need to repeatedly refer to a specific worksheet or when you need to refer to multiple worksheets in your code. The location and time to establish these variables can vary depending on your specific code, but some common locations include at the beginning of your code module or in a separate module designated for storing global variables. You may also establish variables within specific subroutines or functions if they are only needed in that particular context.