'All of my macros are now failing due to Compile error: Expected Function or variable
I've been using these macros for months and recently every single macro that I normally use is failing due to the Compile error: Expected Function or variable. Here is one example:
Sub Cleaner_Surveillance()
'
' Cleaner_Surveillance Macro
'
Columns("A:A").Select
Range("A6").Activate
Range(selection, selection.End(xlToRight)).Select -> It highlights the 1st "selection"
selection.ColumnWidth = 123.86
Columns("A:F").EntireColumn.AutoFit
Cells.Select
Cells.EntireRow.AutoFit
Rows("6:6").Select
selection.AutoFilter
Cells.Select
Cells.EntireColumn.AutoFit
Range("A1:F1").Select
'
End Sub
All of my macros fail at the "selection" portion. Even if I write a new macro, it will fail at "selection." Did something get corrupted? I'm using Microsoft Office Professional Plus 2016.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
