Implicit Active Sheet Reference
Locates unqualified Worksheet.Range/Cells/Columns/Rows member calls implicitly referring to ActiveSheet.
Reasoning
Implicit references to the active worksheet (ActiveSheet) rarely mean to be working with *whatever worksheet is currently active*. By explicitly qualifying these member calls with a specific Worksheet object, the assumptions are removed, the code is more robust, and will be less likely to throw run-time error 1004 or produce unexpected results when the active sheet isn't the expected one.
Default severity
Warning
Inspection type
LanguageOpportunities
This inspection will only run when the Excel library is referenced
Examples
This example should trigger a result
This example should NOT trigger a result
Rubberduck.CodeAnalysis.Inspections.Concrete.ImplicitActiveSheetReferenceInspection.cs (Prerelease-v2.5.9.6289)