Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Error in Macro: "Method 'Paste' of object '_Worksheet' failed"

Hi,
I'm pretty new to working with VB, so excuse me if this is just
something simple I have overlooked. I have a fairly simply macro that
moves all the Cells in a range down the sheet by 1 (by cutting and
pasting). This initially seemed to work, but now i get a "Method
'Paste' of object '_Worksheet' failed" error when I run it. This is the
full macro:

Range("L1:AH500").Select
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollRow = 1
Application.CutCopyMode = False
Selection.Cut
Range("L2").Select
ActiveSheet.Paste
Range("I2:I24").Select
Selection.Copy
Range("L1:AH1").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=True

If anyone can help me, please do!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default Error in Macro: "Method 'Paste' of object '_Worksheet' failed"

Hi Blork,

Following should do the job :
Range("L1:AH500").Select
Selection.Cut
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Select

Beware of your range selection, if you want to repeat the process ...
HTH
Cheers
Carim

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Error in Macro: "Method 'Paste' of object '_Worksheet' failed"

Thanks for your help,
Unfortunately it's still returning with the exact same error, and when
I go to debug the code, "ActiveSheet.Paste" is still highlighted in
yellow.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default Error in Macro: "Method 'Paste' of object '_Worksheet' failed"

Blork,

Is your copy paste done within the same worksheet or not ?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Error in Macro: "Method 'Paste' of object '_Worksheet' failed"

Originally I was attempting to copy/paste from a seperate Workbook, but
when that failed (with that error), I tried it from within the same
sheet, with a modified macro. So, the code that I pasted up there ^^,
that errors out, is working within the same sheet.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default Error in Macro: "Method 'Paste' of object '_Worksheet' failed"

Blork,

I guess you mean to copy-paste between different worksheets within the
same workbook ...
The workbook is equivalent to an excel File, and the worksheets are
represented by the different tabs sheet1, sheet2, sheet3 ...
If you want to operate between sheets, you only have to be specific in
your range definition, and specify which destination sheet you want ...
e.g.

Worksheets("Sheet1").Range("L1:AH500").Select ' for your input
Worksheets("Sheet2").Range("L2").Paste ' for your destination

HTH
Cheers
Carim

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is Error "Method "Paste" of object "_Worksheet" failed? vat Excel Programming 7 February 17th 06 08:05 PM
"method 'Copy' of object '_Worksheet' failed" Terry Holland Excel Programming 1 July 8th 05 04:25 PM
Method 'Paste' of object '_Worksheet' failed markline Excel Discussion (Misc queries) 7 May 28th 05 05:02 AM
Method 'Paste' of object '_worksheet' failed Greg Bloom Excel Programming 4 October 18th 04 06:19 PM
METHOD "SELECT" OF OBJECT '_WORKSHEET' FAILED when opening a file Mat Excel Programming 0 July 8th 04 05:13 PM


All times are GMT +1. The time now is 03:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"