Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm trying to interlace rows of sales numbers from one sheet with
forecast numbers of a second. Get 1st item from Sh1, find that item in Sh2, copy adjacent cells, paste into Sh1 adjacent (and one row lower) to the item there. Thought this would be simple but the offset reference to the range of sales numbers gives me this error: Run-time error '1004': Application-defined or object-defined error Set rngWriteRow = Workbooks("ALL FORECASTS.xls").Worksheets("Forecasts w Sales").Range("A6") Set rngSalesColumn = Workbooks("ALL SALES.xls").Worksheets("Summary").Range("C1:C200") CurrentItem = rngWriteRow.Value Do While CurrentItem < "" '---Find item in sales Set rngReadRow = rngSalesColumn.Find(CurrentItem) '---Copy range offset from sales item to forecast sheet error- Range(rngReadRow.Offset(0, 29), rngReadRow.Offset(0, 200)).Copy Destination:= _ Range(rngWriteRow.Offset(1, 31)) '---Move down one item on Forecast sheet rngWriteRow = rngWriteRow.Offset(2, 0) '---Grab next item and loop CurrentItem = rngWriteRow.Value Loop Why would excel reject this copy? Even if I use .Select instead of the ..Copy I get the same error. It is being executed from the Worksheet_Calculate event handler of the ALL SALES sheet. Anyone see what I am missing here? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Lookup and offset at the same time? | Excel Worksheet Functions | |||
Copy link to offset sheet | Excel Worksheet Functions | |||
Compare Cell Values, Offset(-1,0), Offset(-1,-1), and xlFillDefaul | Excel Worksheet Functions | |||
Find then offset. | Excel Worksheet Functions | |||
range.offset generates a Run Time error 1004 | Excel Programming |