View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
okaizawa okaizawa is offline
external usenet poster
 
Posts: 129
Default Problems with Paste

Hi,

copy mode is sometimes released. it is also when a cell is changed.
if so, then 'paste' fails.
we should copy and paste at a time.

--
HTH

okaizawa

pwermuth wrote:
On the last line of the following code fragment I get a runtime error
"Paste method of Worksheet class failed"

Worksheets(sheetToWorkOn).Rows(rowReport).Copy
While dataRow < 500
If Worksheets("Database").Cells(dataRow, partColumn).Value
= partToReportOn Then
valueToPlace = Worksheets("Database").Cells(dataRow,
1).Value
If Application.WorksheetFunction.isNumber(valueToPlac e)
And valueToPlace 0 Then
With Worksheets(sheetToWorkOn).Rows(rowReport)
Interior.ColorIndex = 2
Interior.Pattern = xlSolid
Font.Size = 8
RowHeight = 12
End With
Worksheets(sheetToWorkOn).Paste
Destination:=Worksheets(sheetToWorkOn).Rows(rowRep ort)


To make sure I do not accidentally try to paste into a range that's
different from the copy range I copied the entire row and paste the
entire row, but it still does not work.