Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am getting a run time error '1004' (Application defined or object
defined error) and the debugger seems to be highlighting a relatively simple piece of the code. Below is the section of code that is causing a problem. Do Until (Count = 40) If Trade.FormulaR1C1 = "" Then Set Trade = Trade.Offset(2, 0) Count = Count + 1 Else: Workbooks(file2).Activate Set tag2 = Range("A1") Do Until tag2.FormulaR1C1 = foldername Set tag2 = tag2.Offset(1, 0) <----- This is the problem Loop Set YTD2 = tag2.Offset(0, Column) YTD2.Copy Monitor.Activate YTD3.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Application.CutCopyMode = False Set Trade = Trade.Offset(2, 0) Set YTD3 = Trade.Offset(1, 2) Count = Count + 1 End If Loop If this is not enough information to get help, I apologize. I've tested the macro by tweaking the code and it opens the second work book fine, and will select a range just fine, it seems to be specifically the "offset" that is causing the problem. I am truly at a loss here, this seems to be such an innocuous piece of code to be causing a problem. Thanks in advance. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Run-time error 1004 - General ODBC Error | Excel Programming | |||
Run time error 1004, General ODBC error | New Users to Excel | |||
run-time error '1004': Application-defined or object-deifined error | Excel Programming | |||
Run time error '1004': Generaol ODBC error | Excel Programming | |||
Application Run Time Error 1004 and Stack Error | Excel Programming |