+ Reply to Thread
Results 1 to 1 of 1

Selection.Interior.Color = Selection.DisplayFormat.Interior.Color not working. Do I wrong?

  1. #1
    Registered User
    Join Date
    11-13-2019
    Location
    Leusden, Netherlands
    MS-Off Ver
    2016 or 2019 (depends on PC)
    Posts
    12

    Selection.Interior.Color = Selection.DisplayFormat.Interior.Color not working. Do I wrong?

    Dear all,

    Attached a very small and meaningless XLSM sheet with some conditional formatting.
    This is an example for a larger sheet (about 700 rows and 23 columns). In reality it is
    is generated from a database.
    Requirements:
    - several columns need to be conditionally formatted
    - some the the conditional formats depend on values in other columns: the most right ones.
    - the sheet has to be handed over to a laptop and will be used by elder digital illiterate people
    - so I convert the condition format to permanent format and
    - I remove the conditional formats as well as the columns (rightmost ones) they are based upon. on the laptop they need a larger and bolded font and all columns must be on the screen without scrolling. (Í'll leave out the functional requirements behind it).
    - the sheet is in "table"format for convenience

    I had in mind to convert conditional format to permanent with

    Selection.Interior.Color = Selection.DisplayFormat.Interior.Color.

    But that did not work: it converts the Selection.Interior.Color to 0 (so black!)

    I had to use the less elegant loop over cells to get it working, but I always try to write my code elegantly - as above.:

    For Each Cell In Selection
    Cell.Interior.Color = Cell.DisplayFormat.Interior.Color
    Next Cell


    For this example I used the same code for the 1st 2 columns, based on values in the 3 column: run macro CondFormat to understand it possibly better.
    I expected my 1st attempt also working: Selection is a Range as well isn't it?

    So please comment,

    Best regards, Hans Troost
    Attached Files Attached Files

+ 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. [SOLVED] Color each Bar in a Bar Chart based on Interior Celll Color
    By JonasBig2 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-07-2018, 03:53 AM
  2. [SOLVED] How to get interior.color to use conditional formatting color?
    By tahi.laci in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-28-2015, 12:34 PM
  3. [SOLVED] Capture Interior Color of Conditionally Formatted Cell on Selection Change
    By daffodil11 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-07-2015, 04:31 PM
  4. Find a duplicate and then use the duplicates interior.color to change cell color.
    By bopsgtir in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-01-2012, 03:54 PM
  5. Deleting cell interior of a selection + interior of the row above selection
    By Tim0l in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-24-2011, 07:32 PM
  6. Cell background color (interior color) setting not working
    By Martin E. in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-21-2006, 02:10 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