Then save this code and go back to the worksheet, and then enter this formula in to a blank cell =CountColour(A1:D10,A2), see screenshot: VBA code: Count cells based on font colors: Public Function CountColour(pRange1 As Range, pRange2 As Range) As Double Click Insert > Module, and paste the following code in the Module Window. Hold down the ALT + F11 keys, and it opens the Microsoft Visual Basic for Applications window.Ģ. To calculate the number of cells with specific font colors, please do as these:ġ. Normally, there is no direct way to deal with this task, here, I will talk about some tricks for soling this job.Ĭount or sum cells based on font colors with User Defined FunctionĬount or sum cells based on font color with some useful functionsĬount or sum cells based on font color with an amazing feature-Count by ColorĬount or sum cells based on font colors with User Defined Function Count cells based on font colors: How could you get the number of cells or sum all the cells which contain a particular font color in Excel? For example, I have a range of data in a worksheet as following screenshot shown, and now I want to respectively count or sum the cells that have a red, blue and black font color. How to count or sum cells based on the font colors in Excel?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |