haganator2112
New Member
- Joined
- Feb 28, 2022
- Messages
- 2
- Office Version
- 2016
- Platform
- Windows
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. I sent the below script to a coworker and they were able to run it on their system with no issues.
Sub Cleaner_Surveillance()
'
' Cleaner_Surveillance Macro
'
Columns("A:A").Select
Range("A6").Activate
Range(selection, selection.End(xlToRight)).Select -> It highlights the 1st "selection" for all macros. Should "selection" be capitalized? I tried to manually change this but it won't save it.
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
Sub Cleaner_Surveillance()
'
' Cleaner_Surveillance Macro
'
Columns("A:A").Select
Range("A6").Activate
Range(selection, selection.End(xlToRight)).Select -> It highlights the 1st "selection" for all macros. Should "selection" be capitalized? I tried to manually change this but it won't save it.
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