Greetings,
I would like to build a simple macro to delete charts in the activeworkbook. I have the following written below:
I'm not sure that InStr is the correct function here. I would like a true or false value to return whether the word "Chart" is or is not present in the name. It should always be the first 5 characters of the worksheet name
I would like to build a simple macro to delete charts in the activeworkbook. I have the following written below:
Code:
Dim x As Worksheet
For Each x In ActiveWorkbook.Worksheets
If InStr(1, ActiveWorkbook.Worksheet(x).Name, "Chart", 1) Then
ActiveWorkbook.Worksheet(x).Delete
End If
Next x
I'm not sure that InStr is the correct function here. I would like a true or false value to return whether the word "Chart" is or is not present in the name. It should always be the first 5 characters of the worksheet name