Count the #of ISTEXT cells

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Could you help me with the VB code that would perform the following?

Count the number of cells that have text in a range that goes from the
active cell to .End(xlRight)

Thank you!
 
Filo - give this a try. It counts the total number of cells and then
subtracts the number of cells that contain numbers.

Sub CountText()

Dim Count As Integer

Count = Range(ActiveCell, ActiveCell.End(xlToRight)).Cells.Count
Count = Count - WorksheetFunction.Count(Range(ActiveCell,
ActiveCell.End(xlToRight)))
MsgBox "There are " & Count & " cells containing text."

End Sub

-Cory
 
It worked. Thank you!

Cory said:
Filo - give this a try. It counts the total number of cells and then
subtracts the number of cells that contain numbers.

Sub CountText()

Dim Count As Integer

Count = Range(ActiveCell, ActiveCell.End(xlToRight)).Cells.Count
Count = Count - WorksheetFunction.Count(Range(ActiveCell,
ActiveCell.End(xlToRight)))
MsgBox "There are " & Count & " cells containing text."

End Sub

-Cory
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top