+ Reply to Thread
Results 1 to 5 of 5

Deleting conditional formatting rules from multiple workbooks

  1. #1
    Forum Contributor
    Join Date
    12-02-2013
    Location
    england
    MS-Off Ver
    Excel 2007
    Posts
    112

    Question Deleting conditional formatting rules from multiple workbooks

    HI

    I am looking for a code to delete conditional formatting rules from multiple workbooks as each of the workbooks are run.

    For example when one workbook with several sheets containing various conditional formatting rules is executed, the code, should be able to delete those rules from that workbook and so on do the same with other workbooks. Please note some of the worksheets don't have any rules so it should also be able to skip those worksheets while deleting formats.

    To run the first workbook i have the following code

    Set myData1 = Workbooks.Open("C:\FINAL ANSWER\FOLDER4\FOLDER3\MAINDATA1\MAIN DATA.xlsm")
    myData1.Save
    myData1.Close

    and the solution is to add some lines of code to clear those formatting rules from contained worksheets.

    A sample workbook is also added.

    Thank you
    Attached Files Attached Files
    Last edited by LAVA2; 01-31-2019 at 12:11 AM. Reason: missing info

  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,516

    Re: Deleting conditional formatting rules from multiple workbooks

    From jindon in another post.
    Insert in your code.
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    12-02-2013
    Location
    england
    MS-Off Ver
    Excel 2007
    Posts
    112

    Re: Deleting conditional formatting rules from multiple workbooks

    Hi, jolivanes can you also please mention where to insert that code in terms of

    Set myData1 = Workbooks.Open("C:\FINAL ANSWER\FOLDER4\FOLDER3\MAINDATA1\MAIN DATA.xlsm")
    myData1.Save
    myData1.Close

    Set myData2 = Workbooks.Open("C:\FINAL ANSWER\FOLDER4\FOLDER3\MAINDATA2\MAIN DATA.xlsm")
    myData2.Save
    myData2.Close

  4. #4
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,516

    Re: Deleting conditional formatting rules from multiple workbooks

    I don't understand what you're doing.
    Why are you only opening a workbook and then close it again without doing anything (as in your attachment codes)

    Or is this what you mean?
    Please Login or Register  to view this content.
    Last edited by jolivanes; 01-31-2019 at 01:42 AM. Reason: Add info

  5. #5
    Forum Contributor
    Join Date
    12-02-2013
    Location
    england
    MS-Off Ver
    Excel 2007
    Posts
    112

    Re: Deleting conditional formatting rules from multiple workbooks

    i tried that but it gives compiler error at the end and also it doesn't clear formatting rules from "C:\FINAL ANSWER\FOLDER4\FOLDER3\MAINDATA1\MAIN DATA.xlsm"
    Last edited by LAVA2; 01-31-2019 at 03:50 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Multiple Conditional Formatting Rules
    By greggor36 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-20-2018, 08:27 AM
  2. Replies: 4
    Last Post: 03-28-2018, 04:21 PM
  3. [SOLVED] Using if and And together in conditional formatting multiple rules!
    By Katieloulouise in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 02-03-2015, 01:00 PM
  4. Replies: 1
    Last Post: 08-31-2014, 03:38 PM
  5. Conditional Formatting with multiple rules
    By carrod65 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-24-2012, 03:43 PM
  6. Replies: 1
    Last Post: 08-26-2011, 08:39 PM
  7. Conditional formatting multiple rules
    By candrew03 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-16-2011, 02:35 PM

Tags for this Thread

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