Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Having serious issues with copying arrays

Status
Not open for further replies.

Neenas19

Technical User
Apr 10, 2002
22
US
Hello, I am attempting to copy arrays across several rows and columns. And I am getting some VERY strange behavior. So say I select 200 rows and 10 columns to paste into, the application randomly ( as in sometimes does this and other times does not) selects a row in the selection and discontinues the paste process. Then I am unable to paste into that row at all! I went into the code and wrote a little macro so that I could step through the process. I got the following error
Paste method of worksheet class failed.

Any ideas????
Thanks in advance for any assistance
Nina
 

...say I select 200 rows and 10 columns to paste into...

You didn't indicate what you copied prior to your attempted paste, but if the shape of the copied range doesn't go evenly into your 200 by 10 then the paste will fail.

For example, you could paste a range that was copied from 50 rows and 5 columns, or 100 rows and 2 columns, or 4 rows and 1 column, but if you copied 6 rows or 3 columns, it doesn't go evenly.

If that doesn't answer your question, then please advise exactly what is it that you are trying to do.

 
I am copying only one cell. The paste is sucessful for many of the rows and columns, just randomly decides to fail.
 
Protected cells?
Merged cells?
What macro code did you try?
 
Not protected, not merged. Nothing funny at all about ANY of it. Tried in several different spreadsheets and workbooks. Tried a reboot all to no avail. Here is what I put together to step through the process. This was after several attempts of right click copy/paste, drag down etc....
Worksheets("sheet4").Range("c2").Select
Selection.copy
Range("D2:D250").Select
Activesheet.paste


Again the code will work sometimes and not others.....
 
Hmmmm. I can't get it to fail. Seems simple enough. Hate to say it but you may need to re-install Excel (Office).

Maybe someone else here has an idea.

 
ARG! I was hoping it was going to be something easy like a maximum capacity of the clipboard or something. Oh well. Thanks for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top