View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Aaron Aaron is offline
external usenet poster
 
Posts: 287
Default An error in some code I did not write

Amoung other things the code say what you see below, but it hangs up on the
second to last line, "Cells(x, 16) = FORD.Offset(o, 13)" the code worked
last month when we used it. What might have changed in the spreadsheet to
make it hang up here?


x = Cells.Find(What:="*", SearchOrder:=xlByRows,
SearchDirection:=xlPrevious).Row + 1
Cells(x, 1).Select
ActiveSheet.Paste
x = Cells.Find(What:="*", SearchOrder:=xlByRows,
SearchDirection:=xlPrevious).Row

While x 1
ord = Cells(x, 1)
Set FORD = Sheets("ORDERHEAD").Columns("A:A").Find(What:=ord,
LookIn:=xlValues, lookat:=xlWhole)

Cells(x, 13) = FORD.Offset(0, 8) 'incom code EHIC
On Error Resume Next
Cells(x, 14) = Cells(x, 13) - Cells(x, 12)
On Error GoTo 0
Cells(x, 15) = Format("'" & Cells(x, 5), "") & Format(Cells(x, 12), "")
Cells(x, 16) = FORD.Offset(o, 13)
End If