Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Run Time Error

I am getting a Run time Error 1004 Method 'Range' of
object'_Global' failed.

Here is my code and I will show the line that the
debugger shows. Any help would be great. Thanks

x = i
y = i - 2
Do Until i = FinalRow

***(This Row) If Not ((Range("E" & y).Value) = (Range("D"
& x).Value)) And Not (x = FinalRow) Then
x = x + 1
End If

If (Range("E" & y).Value) = (Range("D" & x).Value) Then
Call OtherSections(i, x)
Do Until (Range("F" & (i - 1)).Value) = ""
ChildRow = Columns(1).Find(What:=(Range("F" & (i -
1)).Value), LookIn:=xlFormulas).Row
Call OtherSections(i, ChildRow)
Loop
y = i - 2
Else
y = y - 1
End If

Loop


i is the next row that is going to have something pasted
to it.

x is the number of the row as it checks to see if the
value in D equals the value in E

y is another counter in case D never equals E, y moves
the row that E is in up one.

At the end of the called funtion i gets increased by 1.

Thank you very much
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 196
Default Run Time Error

what does the counter i start at?

Since y = i - 2, if i starts anywhere below 3, trying to
access range("E" & y) would cause it to access cell E0, or
E-1, etc... which don't exist.

That would give you the error you mentioned.


-----Original Message-----
I am getting a Run time Error 1004 Method 'Range' of
object'_Global' failed.


  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Run Time Error

i starts at 3



-----Original Message-----
what does the counter i start at?

Since y = i - 2, if i starts anywhere below 3, trying to
access range("E" & y) would cause it to access cell E0,

or
E-1, etc... which don't exist.

That would give you the error you mentioned.


-----Original Message-----
I am getting a Run time Error 1004 Method 'Range' of
object'_Global' failed.


.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 196
Default Run Time Error

i starts at 3


well good, then.

I just put the code into a sheet here, and it works.

When it buggs, can you press 'Debug' and then position the
cursor over your variables to see what they are at the
time of the failure?

Or put in some Watches for them and step through?
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Basic Error Run Time Error, Type Mismatch Meg Partridge Excel Discussion (Misc queries) 12 September 10th 08 06:10 PM
Run time error 1004, General ODBC error [email protected] New Users to Excel 0 September 19th 05 01:41 AM
Code Error - Run Time Error 5 (Disable Cut, Copy & Paste) Tim[_36_] Excel Programming 4 April 23rd 04 02:53 AM
Run-time error '11' & Run-time error '1004' Piers Clinton-Tarestad Excel Programming 0 January 9th 04 08:35 PM
Run-time error '11' & Run-time error '1004' Piers Clinton-Tarestad Excel Programming 0 January 9th 04 07:45 PM


All times are GMT +1. The time now is 02:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"