ItalianPlatinum
Well-known Member
- Joined
- Mar 23, 2017
- Messages
- 880
- Office Version
- 365
- 2019
- Platform
- Windows
I am looking for a way to improve the way I am clearing my sheets by looping through and looking for maybe something faster. ie, clearing all worksheets in my workbook except 2 or 3 I list. Currently I have 20 worksheets
VBA Code:
' Run loop to clear sheets that would be in use
i = 0
Do Until WsCus.Range("FILTER").Offset(i, 0) = ""
FILTER = WsCus.Range("FILTER").Offset(i, 0)
SheetName = WsCus.Range("FILTER").Offset(i, -1).Value 'Assuming from your screenshot it's in the column left of the filter
Worksheets(SheetName).Cells.ClearContents
i = i + 1
Loop