Problem with Range function after SP3 installed

  • Thread starter Thread starter Francesco M.
  • Start date Start date
F

Francesco M.

Hi all,
I use this function to iterate through a vertical range of cells:

Set zone = Sheets(1).Range([A1], [A1].End(xlDown))

For Each dom In zone
.....
Next

Unfortunately after I have installed SP3 on Excel 2002 this doesn't work anymore.
The compiler issues an error on the blocks delimited by parenthesis
([A1] f.example).

Has something changed that disallow reading a range of cells ?
Hope somebody can help me...
Thanks alot
Francesco
 
Hi Francesco,

I think your problem is one of qualification and is independent of the
version in use.
Set zone = Sheets(1).Range([A1], [A1].End(xlDown))

worked for me only if Sheets(1) is the active sheet. Since you do not
qualify [A1], this refers to the A1 cell on the active sheet.

You can avoid the problem by qualifying, e.g.:

With Sheets(1)
Set zone = .Range(.[A1], .[A1].End(xlDown))
End With

or, better (IMHO):

With Sheets(1)
Set zone = .Range(.Range("A1"), .Range("A1").End(xlDown))
End With


---
Regards,
Norman



Francesco M. said:
Hi all,
I use this function to iterate through a vertical range of cells:

Set zone = Sheets(1).Range([A1], [A1].End(xlDown))

For Each dom In zone
.....
Next

Unfortunately after I have installed SP3 on Excel 2002 this doesn't work
anymore.
The compiler issues an error on the blocks delimited by parenthesis
([A1] f.example).

Has something changed that disallow reading a range of cells ?
Hope somebody can help me...
Thanks alot
Francesco
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top