Function ConcatenateByColor(srcColor As Range, NumberRange As Range)
Application.Volatile
Dim clr As Long, c As Range, s As String
clr = srcColor.Interior.Color
For Each c In NumberRange
If c.Interior.Color = clr And IsNumeric(c) And c <> "" Then s = s & c & ","
Next
If Len(s) Then ConcatenateByColor = Left(s, Len(s) - 1)
End Function
Book2 | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | AA | AB | AC | AD | AE | AF | AG | AH | |||
4 | 73 | 50 | 4 | 65 | 96 | 56 | 21 | 12 | 84 | 62 | 41 | 51 | 52 | 6 | 26 | 64 | |||||||||||||||||
5 | |||||||||||||||||||||||||||||||||
6 | 73,65,96,56,21,12,84,62,41,51,52,6,26,64,99,85 | ||||||||||||||||||||||||||||||||
7 | |||||||||||||||||||||||||||||||||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
D6 | D6 | =concatenatebycolor(D4,G4:AK4) |
Yes, but what is the formula?use a formula to determine which cells to format
That is not a Conditional Formatting formula and the rest of the explanation is confusing given that we are not familiar with your data.if cell = "A", "True", "False"