Hello, I have always wondered if there was a to perform operations based on a cells format without using macros. What I would like to do is count the number of cells in a range formatted yellow.
Hello, I have always wondered if there was a to perform operations based on a cells format without using macros. What I would like to do is count the number of cells in a range formatted yellow.
You could do this with a user defined function but would this count as a macro?
Martin
Hmmm I suppose not in this case. I've never set up a user defined function before. How would I do this?
Try this
Open the VBA editor by hitting Alt F11.Please Login or Register to view this content.
Insert a new module with Insert - Module
Paste in the above function
Go back to the sheet by hitting Alt F11.
In a suitable cell, enter = =CountYellow(A1:H19) etc.
Remember to save the workbook as a macro enabled workbook .xlsm
Note that as formatting a cell does not trigger the calculation to happen, you will not see dynamic behaviour if you just add or remove yellow formatting.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks