Excel range from active sheet

I'm writing an Excel 2007 macro and I want to select a certain range from my active worksheet.

I tried using this:
    currRange = ActiveSheet.Range("List1")

But I get the error number 1004 on this line.
I just can't figure it out...
LVL 1
Nickman87Asked:
Who is Participating?
 
Patrick MatthewsConnect With a Mentor Commented:
Nickman87,

1) What is the error message?  I do not have the error numbers memorized.

2) Are you quite sure that the name List1 exists, and that it refers to a range on the current
ActiveSheet when the macro hits that line?

Regards,

Patrick
0
 
Patrick MatthewsCommented:
Set currRange = ActiveSheet.Range("List1")
0
 
Patrick MatthewsCommented:
Nickman87,

With object variables, you must use the Set statement.

Regards,

Patrick
0
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

 
Nickman87Author Commented:
I tried this now :
    Dim currRange As Object
    Set currRange = ActiveSheet.Range("List1")

Still with no succes. I keep on getting the same error on the same spot.
0
 
Nickman87Author Commented:
The error I get is this (in dutch):
        Door de toepassing of het object gedefinieerde fout
Wich is something like this in English:
        Error defined by the application or the object

So, what this actually means is that the object (I guess) is throwing me an Error (for some reason...)

I am sure the name "List1" exist, but could it be a problem that it is defined in two sheets?

Kind regards,
Nick
0
 
Nickman87Author Commented:
I found the problem...
Apparently the Range was not defined... I just tried on another computer and here the range does not exist...

Thanks for you help!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.