View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Set a counta function result in a for loop (Macro Excel)

Hi,

You can do this
test = WorksheetFunction.CountA(Range("F2:F200"))

and then set up a loop like this

For X = 1 To test
' do things
Next

or even like this
For X = 1 To WorksheetFunction.CountA(Range("F2:F200"))
'do things
Next


Mike

"whitebalance" wrote:

Hi,
I'm trying to use a result from a counta() function.
Is it possible to set i.e.
test = counta(F2:F200)
and then use it as boundary for the for loop:
for x = 1 To test?

regards
Kristoffer