sspatriots
Well-known Member
- Joined
- Nov 22, 2011
- Messages
- 585
- Office Version
- 365
- Platform
- Windows
As the thread title suggest, I cannot get a small piece of code to loop through some specific worksheets in a workbook to delete the entire contents on each worksheet (including tables). Below is what I have, but no matter what I do to it, it doesn't loop to the next worksheet. I'm guessing there is some simple principle that I'm missing here, but can't find it. Any help is much appreciated. Thanks, Steve
VBA Code:
Dim Sht As Variant
Dim Shts As Variant
Shts = Array("2023", "2022", "2021", "2020", "2019")
For Each Sht In Shts 'Loop Sheets Code goes here:
Cells.Select
Selection.ClearContents
Next Sht