kelly mort
Well-known Member
- Joined
- Apr 10, 2017
- Messages
- 2,169
- Office Version
- 2016
- Platform
- Windows
Hello All,
I have this code for clearing data from certain range of some sheets in my workbook. What I want the case statement to do is to pick sheets that I want to exclude from the clearing.
The sheets listed above are those that the
code is rather clearing data from. I wish I could list those that are to be excluded instead because they are few. I need the bigger brains to help fix this challenge for me.
Thanks
I have this code for clearing data from certain range of some sheets in my workbook. What I want the case statement to do is to pick sheets that I want to exclude from the clearing.
Code:
Sub ClearRange()
Dim Wsheet As Worksheet
For Each Wsheet In Worksheets
Select Case Wsheet.CodeName
Case "Sheet2", "Sheet4", "Sheet6"
Case Else
Range(Cells(2, 1), Cells(200, 10)).Select
Selection.ClearContents
End Select
Next
End Sub
code is rather clearing data from. I wish I could list those that are to be excluded instead because they are few. I need the bigger brains to help fix this challenge for me.
Thanks