Private Sub Workbook_Open()
Dim WB As Workbook
Set WB = ActiveWorkbook
WB.Sheets("Automation").Range("U23:W467").Select
Selection.ClearContents
End Sub
From what I can gather from SO, this code should automatically clear contents in those cells when I open the workbook. However, it doesn't. When I step into the code everything works fine and the cells are cleared.
Any help is appreciated!
Where is the code for sub Workbook_Open()
placed?
If you put it in the ThisWorkbook
class it should run.
If you have it in a regular code module it will not run with that name, but you could call the sub Auto_Open()
instead and it should run automatically.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With