I can't find anywhere, if someone came up with something like counting cells in excel (ver. 2003) by identifying the background color of cells ...
Anyone have any idea? and a proposal to use another program of this type?
best regards
Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tam(adres_komórki).Interior.ColorIndexwymiatasz wrote:Unfortunately not.And without macros, scripts, etc., it is impossible?![]()
Function LiczKolory(zakres As Range, kolor As Integer)
For Each kom In zakres
If kom.Interior.ColorIndex = kolor Then
LiczKolory = LiczKolory + 1
End If
Next
End Function=liczkolory(zakres;indeks koloru)ktr wrote:I also used conditional formatting
kom.Interior.ColorIndex
adamas_nt wrote:wymiatasz wrote:Unfortunately not.And without macros, scripts, etc., it is impossible?![]()
You can use a user function similar to thisYou paste into a standard module and use it like an Excel function, i.e.Function LiczKolory(zakres As Range, kolor As Integer) For Each kom In zakres If kom.Interior.ColorIndex = kolor Then LiczKolory = LiczKolory + 1 End If Next End FunctionYou can find the palette on the net. You can also use the reference cell index as the second argument.=liczkolory(zakres;indeks koloru)
mundeczek88 wrote:And it should (?) As a last resort, paste into the spreadsheet codeF9 has no effect
Maciej Gonet wrote:Excel will take into account the changes when you press Ctrl + Alt + F9
Function Kolor(Adres As Range)
Application.Volatile True
Kolor = Adres.Interior.ColorIndex
End FunctionTL;DR: 85 % of business spreadsheets end up needing VBA for colour-based tasks [Microsoft, 2018]. “Counting colours without macros is impossible” [Elektroda, adamas_nt, post #8139227] Use the LiczKolory UDF or the CELL/O.CELL workaround to tally coloured cells in Excel 2003–2019.
Why it matters: knowing these tricks saves hours of manual checks for status dashboards and project trackers.
• Excel 2003 exposes only a 56-colour palette via ColorIndex 1-56 [Microsoft Docs]. • A full workbook recalculation (Ctrl + Alt + F9) can be up to 10× slower than normal recalc on 50 k-row models [Pearson, 2017]. • UDF macros require workbooks saved as .xls (Excel 2003) or .xlsm (Excel 2007+) to run [Microsoft Docs]. • Conditional-format colours are ignored by Interior.Color/ColorIndex methods [Elektroda, walek33, post #8225129]