Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Is there a way to count/sum cells by their formatting? For example, could I
count or sum the number of cells that are "Highlighted" or that the text was "Bold"? |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Gene
You could create a function that would do what you want. For example, to count the cells in a range that are bold, this should work Function test(R1) Application.Volatile For Each cl In R1 If cl.Font.Bold = True Then Count = Count + 1 End If Next cl test = Count End Function If on your spreadsheet you enter =test(range) in a cell, the cell value will be the number of bold cells in the range. The "application.volatile" causes the UDF to calculate when the worksheet recalculates, but, simply changing the font to bold in a cell doesn't trigger the recalc. You could change the If loop to coutn or sum pretty much anything you want. Good luck. Ken Norfolk, Va GeneR wrote: Is there a way to count/sum cells by their formatting? For example, could I count or sum the number of cells that are "Highlighted" or that the text was "Bold"? |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Ken,
I certainly appreciate the help, but I think you lost me somewhere. Is there an example or something in a little more plan language you could show me? " wrote: Gene You could create a function that would do what you want. For example, to count the cells in a range that are bold, this should work Function test(R1) Application.Volatile For Each cl In R1 If cl.Font.Bold = True Then Count = Count + 1 End If Next cl test = Count End Function If on your spreadsheet you enter =test(range) in a cell, the cell value will be the number of bold cells in the range. The "application.volatile" causes the UDF to calculate when the worksheet recalculates, but, simply changing the font to bold in a cell doesn't trigger the recalc. You could change the If loop to coutn or sum pretty much anything you want. Good luck. Ken Norfolk, Va GeneR wrote: Is there a way to count/sum cells by their formatting? For example, could I count or sum the number of cells that are "Highlighted" or that the text was "Bold"? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Any way to count cells contining one, or more STRIKETHROUGHS? | Excel Discussion (Misc queries) | |||
Count Cells Mutiple Criteria | Excel Discussion (Misc queries) | |||
checking that cells have a value before the workbook will close | Excel Worksheet Functions | |||
Can I count cells with specific format (e.g., yellow field?) | Excel Worksheet Functions | |||
Count Position of Filtered TEXT cells in a column | Excel Worksheet Functions |