Excel - Get color code

Ask a question




You can make use of this macro to get the color code:


Sub distri_color()  
Dim i
For i = 1 To 12
Worksheets(1).Range("C" & i).Value = Worksheets(1).Range("B" & i).Interior.Color
Next i
End Sub
  • 'Replace 12 by the number of rows you want to use.
  • 'Replacing the I in the column that you want to use for the result (color code).
  • 'Replace the B by the column containing the color you want to filter.
Jean-François Pillou

Jean-François Pillou - Founder of CCM
Better known as Jeff, Jean-François Pillou is the founder of CommentCaMarche.net. He is also CEO of CCM Benchmark and digital director at the Figaro Group.

Learn more about the CCM team

Related