+ Reply to Thread
Results 1 to 4 of 4

Conditional Formatting - Run Time Error '13' Type Mismatch Error

  1. #1
    Registered User
    Join Date
    02-18-2004
    Posts
    71

    Conditional Formatting - Run Time Error '13' Type Mismatch Error

    I have been trying to work out how to remove the conditional formatting (CF) from some cells but not the effects of that formatting ie if the CF sets the shading to grey, I need to remove the CF but leave the cell shaded grey. I have learnt that this seems to be only possible via the use of macro's. I have found one such macro that I have copied, however when I run it within my spreadsheet I get a Run Time Error '13'

    Here's the code:

    Please Login or Register  to view this content.

    Please Login or Register  to view this content.

    Please Login or Register  to view this content.

    I get the error at the line
    Please Login or Register  to view this content.
    Is anyone able to help me work out why I am getting this error?

    Thanks

    Karen
    Last edited by VBA Noob; 10-15-2008 at 04:35 PM.

  2. #2
    Registered User
    Join Date
    09-07-2007
    Posts
    1

    Modification of PasteFC

    Hello!

    I also got type mismatch 13.
    Here is my modification of PasteFC, which does not give type mismatch 13 for me.

    I am in Norway so I added some lines to
    transform formulas from national format to US format (This is not fully tested
    because I did not have very complicated formulas as format condtions)

    We also had some text that was hidden by the conditional formatting by making the text white. This text is removed by first making it blue, and then
    removing all blue text (all visible text in the report was black)

    The code is in the attached file PasteFCmod.txt.

    Anne Karin
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    10-10-2008
    Location
    Austin TX
    Posts
    1

    Further adjustments to the macro

    Hi-- I just came across this, thanks for sharing the code Karin!

    This may be a cold thread, but I thought I should share some changes I made to this code. I found that my Mac Office 2004 version of Excel didn't like the underscore as a line break indicator, so I had to remove them; I also discovered that the macro would faithfully translate patterns, but it would not catch the color of the pattern. I've added a line to correct that.

    Thanks too to Chip for the original macro!

    -- Robert
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    11-17-2011
    Location
    Washington
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Conditional Formatting - Run Time Error '13' Type Mismatch Error

    I am using Excel 2010 and object browser shows that FormatConditions(index) returns a generic object not a FormatCondition object. I'm having Type Mismatch on this line in the ActiveCondition function:

    Set FC = Rng.FormatConditions(Ndx)

    If I change the definition of FC to:
    Dim FC as Object

    Then I am able to Set FC = Rng.FormatConditions(Ndx), but I have errors further down as soon as I attempt to use child objects of a FormatCondition object.

+ Reply to Thread

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