+ Reply to Thread
Results 1 to 2 of 2

Excel 2010 VBA to set CF clears formatting of new inserted rows in Table Style

  1. #1
    Forum Contributor
    Join Date
    11-17-2018
    Location
    Los Angeles
    MS-Off Ver
    Office 2010
    Posts
    208

    Excel 2010 VBA to set CF clears formatting of new inserted rows in Table Style

    I have a mystery here and I hope some one can help me understand it, please.

    I have a Table (with Table Style format) to which I have applied a CF to hide all rows not containing the value entered in cell H1. Actually, not really, it just turns the font to light gray to pretend to hide them. If the row has the value from H1, then those rows don't get their font grayed-out.


    When I apply the CF and I only adjust the Font color, all works fine, as expected.


    HOWEVER, when I apply the CF and I also adjust the FILL color (I set it to white), then some rows will be blanked out, when they shouldn't - the others are untouched. I have noticed that this happens if I insert new rows in the table. I would think not much of it if all rows would turn white either when nothing is typed in cell H1, or when it has something. Buy why, either way, some rows get filled in white with no logic of cause and effect. The other odd part of this mystery is that when I search for a one character string, then even some rows that do not have that one character will NOT be blanked out (or their font greyed out) when they should. For example, if you put the number 4 in H1, then the last row of the table will not be blanked out indicating that it has the character, but it does not.

    Why does this happen?

    This is the CF formula I use when applying it via the Conditional Formatting Manager:

    CF Formatting: Font gray RGB(217, 217, 217) and Fill white RGB(255, 255, 255) for the range A4:Z28

    Please Login or Register  to view this content.

    Here is the VBA I am using:

    Please Login or Register  to view this content.

    I do need to use the CF via a VBA though.


    Thank you so much in advance.
    Last edited by Luisftv; 05-15-2023 at 07:59 PM.

  2. #2
    Forum Contributor
    Join Date
    11-17-2018
    Location
    Los Angeles
    MS-Off Ver
    Office 2010
    Posts
    208

    Re: Excel 2010 VBA to set CF clears formatting of new inserted rows in Table Style

    Well,

    After a long time of trial and error, I found a solution which works as it is expected and so far no glitches:


    Please Login or Register  to view this content.

    So that's the end of this mistery.

+ 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. Inserted Object Name Excel 2010
    By yegorexcel in forum Excel General
    Replies: 3
    Last Post: 01-03-2018, 05:57 PM
  2. Replies: 1
    Last Post: 12-08-2016, 03:14 PM
  3. [SOLVED] Macro that copies and inserts row but clears data in newly inserted row
    By Jamidd1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-09-2016, 08:39 AM
  4. Copy formulas and formatting into new rows added to a table when they are inserted
    By robwebber in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-17-2015, 05:01 AM
  5. [SOLVED] Excel 2010 - Absolute References do Not Apply to Inserted Rows?
    By Ksherer in forum Excel General
    Replies: 3
    Last Post: 11-18-2013, 12:57 PM
  6. [SOLVED] 2010 Table Function Not Formatting New Rows
    By kmcbriarty in forum Excel General
    Replies: 10
    Last Post: 08-06-2013, 12:27 AM
  7. Excel 2007 : Pivot table clears conditional formatting
    By tgorski31 in forum Excel General
    Replies: 0
    Last Post: 04-15-2010, 04:43 PM

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