Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Visual Basic Error Run Time Error, Type Mismatch | Excel Discussion (Misc queries) | |||
Run time error 1004, General ODBC error | New Users to Excel | |||
Code Error - Run Time Error 5 (Disable Cut, Copy & Paste) | Excel Programming | |||
Run-time error '11' & Run-time error '1004' | Excel Programming | |||
Run-time error '11' & Run-time error '1004' | Excel Programming |