View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
[email protected] halimnurikhwan@yahoo.com is offline
external usenet poster
 
Posts: 113
Default Counting a range of cells with TEXT

Hi,

Why you don't use Worksheet function to this with:
=COUNTIF(A1:A6,"apple")

but if you want it programtically use:
sub countsomething()
dim j as long, v
v = 0
for j = 1 to 6
if cells(j,1).value= "apple" then v = v+1
next j
msgbox v
end sub

Regards,

halim


F. Lawrence Kulchar menuliskan:
If i have the following range, for example:

A
1 apple
2 35.5236
3 abc
4 s
5 625
6 inv

How can I program the NUMBER of cells that returns a text value...(in this
example, the answer would be 4)??

Thank you,

FLKulchar