One way:
Dim nCount As Long
On Error Resume Next
nCount = Selection.SpecialCells( _
Type:=xlCellTypeConstants, _
Value:=xlTextValues).Count
On Error GoTo 0
MsgBox "Number of Text Values: " & nCount
In article .com,
wrote:
Does anyone know of a VBA code that I can use that will count the
number of cells in a selected column that contain text only, no blanks
or formulas? Thank you.