Loops

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

Guest

I need a loop function in excel... is there such a thing?
What I need is for excel to look over a range of cells and
if there is data written in the cells to increment a
counter and if it is blank to not increment and move on to
the next cell. If I were programming in C I would use a
FOR loop but I can't find any loops in the excel function
list. Please help me out... thanks
 
Hi
not really sure what you're trying to do but in the VBA
help look for
'for next'
'for each'
'do while'

in your example you may use something like

dim rng as range
dim cell as range
set rng = range ("A1:A10")
for each cell in rng
'do your stuff
next
 
Hi anonymous
If you just want to count the non-blank cells then use the COUNTA function. If you truely want to run a loop then you have to use VBA. Functions can only perform calculations

Good Luck
Mark Graesse
(e-mail address removed)
Boston M

----- (e-mail address removed) wrote: ----

I need a loop function in excel... is there such a thing?
What I need is for excel to look over a range of cells and
if there is data written in the cells to increment a
counter and if it is blank to not increment and move on to
the next cell. If I were programming in C I would use a
FOR loop but I can't find any loops in the excel function
list. Please help me out... thank
 
you Rule! thanks

-----Original Message-----
Hi anonymous:
If you just want to count the non-blank cells then use
the COUNTA function. If you truely want to run a loop
then you have to use VBA. Functions can only perform
calculations.
 
Back
Top