|
-
Jul 19th, 2005, 12:38 PM
#1
Thread Starter
Member
runtime error 1004 help
Hi Guru's..
I am getting this runtime error
Method 'Range' of object '_Global' failed
Here is the code causing it:
Public Sub AddChartSheet()
Dim dataRange As Range
CAUSING ERROR ---> Set dataRange = Range(avgRange.averageRange.Text)
avgRange.Hide
....
End Sub
avgRange is the name of my UserForm, averageRange is the name of the RefEdit object. Concerning the scope of my variable, do I need to declare anything global?
Thanks!!
-
Jul 20th, 2005, 01:21 AM
#2
Fanatic Member
Re: runtime error 1004 help
Are you sure your RefEdit text is a valid range? The "_Global" doen't refer to declaration of variables. It is the default object when no object is defined. So if the text in your RefEdit does not repesent a valid worksheet or cell reference, you would get this error message. Bascially it means that the range in the RefEdit test is nowhere to be found within the Excel object. A blank RefEdit would return this error. Note that the RefEdit object can be manually changed and therefore does not always refer to a valid range.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|