I have a script in a Module which performs a function, for example, in Sheet(2) but needs to reference a range within Sheet(1). I am being forced to "Activate" Sheet 1 to avoid receiving an application error when the script attempts to accommodate the referenced range on that Sheet.
Example:
[VBA]
c = Sheets(1).Range("A4", Range("A4").End(xlDown)).Select
[/VBA]
If I am in Sheet2 when this script is run, it receives an error, but it works find if Sheet1 is the active sheet.
Could someone please help me understand the significance and benefit of including "Sheets(1)" in the script if the sheet has to be activated in order for the script to run properly?
Is there a way around this without having to include a "Sheets(1).Activate" statement?