Hello,
I have an Excel workbook with ~ 21 sheets in it.
Let's say 7 are named "Red1", "Red2", "Red3", ect....
Another 7 are named for "Green1, 2, 3", ect...
and the last 7 are named "Blue1, 2, 3", ect...
I'm trying to write a very basic code to go though the entire Workbook, select and then delete all sheets with the name containing "Red*" (regardless of the following number). So far I have:
Sub DeleteRed()
Dim ws As Worksheet
Dim x As Integer
x = 1
For Each ws In ActiveWorkbook.Sheets
x = x + 1
For Each ws In ActiveWorkbook.Sheets
If Left(ws.Name, 3) = "Red" Then
ActiveSheet.Delete
End If
Next ws
End Sub
Yes I am a novice, and any help would be appreciated!
Thank you.