HOME
> Office programs
> Excel: Read Background Color - How It Works
Excel: Read background color - how it works
If you want to read the background color of a cell in an Excel file, there is no standardized function available so far. We will show you how you can still get the information you need. However, you will need some experience with Excel.
This is how you can read out the background color
By applying a custom function in Excel, you can read out the background color - although Excel does not provide a custom function. The basic function is:Function RGB_BackgroundColor(Color As Range)Dim Red As Long, Green As Long, Blue As Long, Value As LongValue = Color.Interior.ColorOn Error Resume NextRed = Value Mod 256Value = (Value - Red) / 256Green = Value Mod 256Value = (Value - Green) / 256Blue = Value Mod 256RGB_BackgroundColor = Red & ", " & Green & ", " & BlueEnd Function- Insert the function by clicking the "Formula" button and selecting the "Insert Function" item in the function library.
- In the dialog box, specify the item "custom". Sie können nun die Funktion „RGB_Hintergrundfarbe“ auswählen.
- Wählen Sie diese mit einem Linksklick aus und bestätigen Sie die Auswahl mit „OK“. Die Zellen werden nun ausgelesen.