Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Nick, think you meant to include the second argument as well:
Sub CountConstants() Dim lConstantCount As Long On Error Resume Next lConstantCount = Selection.SpecialCells( _ xlCellTypeConstants,xlTextValues).Count On Error goto 0 MsgBox "There are " & lConstantCount _ & " Cells with constants in the selection" End Sub Just in case there are constant numbers in the selection as well. -- Regards, Tom Ogilvy Nick Hodge wrote in message ... Soniya the code below will count the cells with constants. (Not formulas, blank, etc) in a selection Sub CountConstants() Dim lConstantCount As Long lConstantCount = Selection.SpecialCells(xlCellTypeConstants).Count MsgBox "There are " & lConstantCount & " Cells with constants in the selection" End Sub -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England HIS "Soniya" wrote in message ... Hi all, How can I count cells containing Text only? TIA Soniya |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Count text in cells? | Excel Discussion (Misc queries) | |||
Count blank cells and cells with text | Excel Discussion (Misc queries) | |||
Count single Text in cells with multiple text entries | Excel Discussion (Misc queries) | |||
How do I count cells with text but ignore cells with spaces? | Excel Discussion (Misc queries) | |||
count cells containing text | Excel Worksheet Functions |