Now save the file as macro enabled workbook (.xlsm) and now we can use the function that we have written to count the number of cells with a particular font color.Įnter the function in cell B2 as shown below. This excel function takes two argument, first argument is the range in which we want to count the cells with same font color and the second argument is the font color reference. ![]() Public Function CountColour(pRange1 As Range, pRange2 As Range) As Double Now double click the newly created module to open that and paste the below code in the module. Insert a module in which we will write a VB function to count the cells with same font color. Go to Developer tab and open VB editor in excel as shown below. ![]() To count the number of cells with a particular font color in a range, we will write a small function in excel VBA as instructed below. ![]() number of blue font, number of red font in a particular range.īelow is an example in which we want to count the number of cells with the same font color and as you can see we have counted the number of font colors in the next column.Īs you can see, we have three cells with font color blue, 2 cells with font color red and so on. In this post we will see how we could count the cells with the same font color e.g.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |