View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
OssieMac OssieMac is offline
external usenet poster
 
Posts: 2,510
Default PasteSpecial Method of Range Class Failed Error a Different Versio

Because you are copying and pasting an entire sheet have you got cell A1
selected in the sheet for the paste otherwise the area will not be large
enough

"SteveC" wrote:



Below is a snippet of code taken from a larger piece of code.

A get a runtime error with the line under "ActiveSheet.Paste" highlighted in
the debugger:

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

any help? can't figure out how to use similar responses on the discussion
groups to fix... thanks very much.

SteveC

starting code... then


Range("A1:IV65536").Select
Selection.Copy
ThisWorkbook.Activate
Sheets(ShName).Select

ActiveSheet.Paste

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

Selection.PasteSpecial Paste:=xlPasteColumnWidths, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

Range("A1").Select

code continues...