View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sourav[_2_] Sourav[_2_] is offline
external usenet poster
 
Posts: 2
Default How to take a range input in a function and find the frequency of data in it.

Hi,
I am trying to write a function which takes a range and returns the
frequency of a data in it.

the function is :-

function freq ( q as variant , datarange as range)
count = 0
for i = 1 to datarange.rows.count
if datarange.cells(i,1). value = q then count= count+1
next i
freq = count
end function

this is not working, can any one suggest what is the prob. I just
learning VBA for excel .
is there any site where i can find tutorial for these, (I have
experience of C.) and a ebook to learn VBA for excel.

Thanks
Sourav