Removing Formats From Entire Worksheet with VBA

Viewed 50891

Using VBA, I am trying to Clear all Formats all entire of the active Worksheet.

Dim ws As Worksheet
 Set ws = ThisWorkbook.ActiveSheet
 With ws
           .ClearFormats
 End With

But I am getting following error:

enter image description here

However using the same code with .UsedRange works fine as:

With .UsedRange
    .ClearFormats
End With

Can you please let me know how fix this to format entire sheet!

1 Answers
Related