+ Reply to Thread
Results 1 to 2 of 2

Help with VBA that detects conditional formatting

  1. #1
    Registered User
    Join Date
    08-19-2011
    Location
    Michigan
    MS-Off Ver
    Excel 2013
    Posts
    17

    Help with VBA that detects conditional formatting

    Hello,

    To preface I'm a noob with VBA but I found a simple VBA function on the web that tests if a cell is bold or not and returns true or false. I also have some conditional formatting set up to turn text bold if it's within a certain date.

    My problem is that even though the conditional formatting works and turns the text bold, the "ISBOLD" function still returns false. Is there a way to modify the VBA functiin to detect the bold text?
    Attached Files Attached Files

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,855

    Re: Help with VBA that detects conditional formatting

    That is because CF applied formats are treated separately from standard formatting.

    You can test this by applying bold formatting to cell. Then override that with CF. It should return true for ISBOLD().

    To check CF is bit more complex.

    You'll first need to determine that there is CF applied to range. Then read FormatCondition's Font.Bold property and check if it evaluates to True.
    And finally, check what type of condition it has, and if it will evaluate to True/False.

    Simplified to just apply to your sample (so this in't checking for FormatConditions type, and only checking Formula1). Something like...
    Please Login or Register  to view this content.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

+ 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. Replies: 1
    Last Post: 06-08-2019, 07:53 PM
  2. [SOLVED] Formula which detects either exact name or partial name
    By ell_ in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-07-2019, 07:51 AM
  3. Loop that detects last row and pastes data below it
    By rjuliano in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-21-2017, 10:41 PM
  4. [SOLVED] Userform detects entire duplicate row before entering information
    By sdhutty in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-15-2016, 06:02 AM
  5. Macro that detects if specific cells are blank, does a pop up
    By lora2014 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-15-2015, 11:48 PM
  6. Opening xlsm files with conditional formatting opens with removed conditional formatting
    By Martijn.Steenbakker in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-07-2014, 05:38 AM
  7. [SOLVED] Macro that detects certain value and replaces value
    By keis386 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-28-2013, 11:54 AM

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