ExcelPupper
Board Regular
- Joined
- Mar 2, 2020
- Messages
- 112
- Office Version
- 2019
- Platform
- Windows
Hello. I have here a code which only runs on the active sheet but I need it to run for all the sheets except one. How to modify this in order for it to run through all worksheets?
VBA Code:
Sub DelData ()
Dim ws as Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Name = "SourceData" Then
Range("A1:A" & Range("A" & Rows.Count).End(xlUp).Row).Delete
Next ws
End If
End Sub