Results 1 to 2 of 2

Batch remove all custom cell styles using VBA

Threaded View

qaliq Batch remove all custom cell... 01-28-2013, 07:33 AM
qaliq Re: Batch remove all custom... 01-28-2013, 07:43 AM
  1. #1
    Registered User
    Join Date
    10-04-2011
    Location
    Windsor, England
    MS-Off Ver
    Excel 2010
    Posts
    69

    Batch remove all custom cell styles using VBA

    Morning everyone,

    I have a spreadsheet that I inherited from someone else which has at least 100 custom cell styles set. I want to be able to delete them all and tried to write a macro to do so
    
    Sub Remove()
    Dim cellst As Style
    For Each cellst In ActiveWorkbook.Styles
          If cellst.BuiltIn = False 
    Then
          cellst.Delete
          End If
    Next
    End Sub
    While this got rid of some of the cell styles it does not remove them all. If i try and manually delete the ones that are there new ones just appear

    Is there something else I can add to the code?

    I have attached a blank copy of the workbook which shows the cell styles.

    Thanks,

    Alice
    Last edited by qaliq; 01-28-2013 at 07:43 AM. Reason: Solved!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1