Results 1 to 2 of 2

Thread: Appending the Cells Interior.Color reference to the cell value

  1. #1
    Acolyte jilbobagins's Avatar
    Join Date
    Apr 2019
    Posts
    61
    Articles
    0
    Excel Version
    2016

    Appending the Cells Interior.Color reference to the cell value



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Hi,

    I basically want to pull a worksheet into power query, however its something another team use every day and color it in based on the status for that cell.

    So I need to understand whilst i'm wrangling data what the source workbook/tables cell color was. Im hoping a clever VBA type might assist!

    So an example would be Cell A1 is filled Red and has the text "Hello", what i'd like to see after a macro is run is within Cell A1 " Hello | 255" ( just added | as a suitable delimiter). The worksheet itself is some 200 rows by 80 columns currently but that's growing all the time.

    ANy help would be appreciated

  2. #2
    Super Moderator p45cal's Avatar
    Join Date
    Dec 2012
    Posts
    1,706
    Articles
    0
    Excel Version
    365
    run after you've selected the cells you want to process:
    Code:
    Sub blah()
    For Each cll In Selection.Cells
      cll.Value = cll.Value & "|" & cll.Interior.Color
    Next cll
    End Sub
    If you want to take into account possible conditional format colours then change cll.Interior.Color to cll.DisplayFormat.Interior.Color

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •