Thread: Range Error
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default Range Error

David,

Two things wrong, perhaps:

Set av_range = Worksheets(1).Range("A2").End(xlDown)

This is now a single cell, and you might actually mean:

Set av_range = Worksheets(1).Range("A2",
Worksheets(1).Range("A2").End(xlDown))

And this:

For Each c In Range("av_range")

Should actually be:

For Each c In av_range

HTH,
Bernie
MS Excel MVP


"David Gerstman" wrote in message
...
I would like to scroll through a column of entries.
So I set up a range:

Dim av_range As Range
Set av_range = Worksheets(1).Range("A2").End(xlDown)

However when I get to the next line

For Each c In Range("av_range")

I get the following error:
Runtime error 1004
Application defined or object-defined error

What exactly am I doing wrong?