Hi, I have added a TableStyle to excel workbook using the statement:
ActiveWorkbook.TableStyles.Add("PivotTable SS")
I can delete it using:
ActiveWorkbook.TableStyles("PivotTable SS").Delete
How can I programmatically check if it already exists before deciding whether to delete or not?
Currently I am looping through all the table styles and doing a selective delete:
For Each ts In ActiveWorkbook.TableStyles
If ts.Name = "PivotTable Style 1" Then
ts.Delete
End If
Next ts
However, this is time-consuming. How can I just check for the pivot table existence and delete it without looping?
Thanks :)