We're aware that some users are experiencing technical issues which the team are working to resolve. See the Community Noticeboard for more info. Thank you for your patience.
📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!

any vba/excel experts around

Options
dipsomaniac
dipsomaniac Posts: 6,739 Forumite
Part of the Furniture 1,000 Posts Name Dropper Combo Breaker
edited 18 September 2018 at 9:09PM in Techie Stuff
anyone know how to count multicolour cells in excel?

rota.jpg

i can count the single colours ok using vba script i found online. i am having trouble counting the purple/red & purple/yellow cells. any help appreciated.

this is the key for the spreadsheet

Inkedrota_key_LI.jpg

vba script

rota_vba_text.jpg
"The Holy Writ of Gloucester Rugby Club demands: first, that the forwards shall win the ball; second, that the forwards shall keep the ball; and third, the backs shall buy the beer." - Doug Ibbotson
«134

Comments

  • thanks neil. i did use google to get this far but can't see how i can count multicolour cells
    "The Holy Writ of Gloucester Rugby Club demands: first, that the forwards shall win the ball; second, that the forwards shall keep the ball; and third, the backs shall buy the beer." - Doug Ibbotson
  • How many cells are there of each of the multicolour types? What is the ColorIndex value of the multicolour cells?
    Retired at age 56 after having "light bulb moment" due to reading MSE and its forums. Have been converted to the "budget to zero" concept and use YNAB for all monthly budgeting and long term goals.
  • dipsomaniac
    dipsomaniac Posts: 6,739 Forumite
    Part of the Furniture 1,000 Posts Name Dropper Combo Breaker
    edited 18 September 2018 at 9:29PM
    thanks for reply

    2 x purple/red
    4 x purple/yellow

    am just trying to find colorindex
    "The Holy Writ of Gloucester Rugby Club demands: first, that the forwards shall win the ball; second, that the forwards shall keep the ball; and third, the backs shall buy the beer." - Doug Ibbotson
  • Well, you've got it in the xcolor variable so you need to be able to output that somehow so that you can see what it is. I think you can use a watch on the value to see what the values are as you step through the code.

    From the numbers I think it could be counting both types of multicolour cell as one, and returning 6 each time (i.e. 2 + 4).
    Retired at age 56 after having "light bulb moment" due to reading MSE and its forums. Have been converted to the "budget to zero" concept and use YNAB for all monthly budgeting and long term goals.
  • that
    that Posts: 1,532 Forumite
    could you not make just those two error ones brown and puce instead of a combination colour?
  • rgb_codes.jpg
    "The Holy Writ of Gloucester Rugby Club demands: first, that the forwards shall win the ball; second, that the forwards shall keep the ball; and third, the backs shall buy the beer." - Doug Ibbotson
  • From the numbers I think it could be counting both types of multicolour cell as one, and returning 6 each time (i.e. 2 + 4).

    pretty sure that's what is happening
    "The Holy Writ of Gloucester Rugby Club demands: first, that the forwards shall win the ball; second, that the forwards shall keep the ball; and third, the backs shall buy the beer." - Doug Ibbotson
  • that wrote: »
    could you not make just those two error ones brown and puce instead of a combination colour?

    thanks, bank holidays are purple and annual leave red. when a/l is taken on a bank holiday i need both colours

    probably is a better way of doing it
    "The Holy Writ of Gloucester Rugby Club demands: first, that the forwards shall win the ball; second, that the forwards shall keep the ball; and third, the backs shall buy the beer." - Doug Ibbotson
  • DoaM
    DoaM Posts: 11,863 Forumite
    10,000 Posts Fifth Anniversary Name Dropper Photogenic
    Purple/Red = Magenta
    Purple/Yellow = Brown

    Use them instead?
This discussion has been closed.
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 350.8K Banking & Borrowing
  • 253.1K Reduce Debt & Boost Income
  • 453.5K Spending & Discounts
  • 243.8K Work, Benefits & Business
  • 598.7K Mortgages, Homes & Bills
  • 176.8K Life & Family
  • 257.1K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16.1K Discuss & Feedback
  • 37.6K Read-Only Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.