View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Finny[_3_] Finny[_3_] is offline
external usenet poster
 
Posts: 49
Default Find, Copy offset to offset on other sheet, Run-time 1004.

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?