Appending the Cells Interior.Color reference to the cell value

jilbobagins

Member
Joined
Apr 11, 2019
Messages
80
Reaction score
0
Points
6
Excel Version(s)
2016
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
 
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
 
Back
Top