Guest User

Untitled

a guest
Dec 9th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. Rem Excel Macro to
  2. Rem count number of cells which assigned non-default colors
  3. Rem ColorIndex for default color is magic number -4142
  4. Rem
  5. Rem Reminder: paste this into Worksheet's Module, save as .xls
  6.  
  7. Function CountAnyColor(rng)
  8. CountAnyColor = 0
  9. For Each c In rng.Cells
  10. If c.Interior.ColorIndex <> -4142 Then
  11. CountAnyColor = CountAnyColor + 1
  12. End If
  13. Next
  14. End Function
Add Comment
Please, Sign In to add comment