Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Paste method fails in VBA


I am trying to paste some 10 rows containing formulas 500 times using
Selection.copy and ActiveSheet.paste.
The macro fails and throws up the error - "Run-time error '1004'. Paste
method of Worksheet class failed". (I clean the clipboard after each
paste.)


--
lalu
------------------------------------------------------------------------
lalu's Profile: http://www.excelforum.com/member.php...o&userid=28055
View this thread: http://www.excelforum.com/showthread...hreadid=475665

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Paste method fails in VBA

Just a thought, are you placing your active cell closer to the edge of
the sheet then what your macro was originally recorded as copying or
pasting,
Another thought, if you are copying the same range to many sheets; you
could group all your sheets together and then work on one sheet to
change all the sheets grouped.
Click on the sheet tab press Ctrl and click on the sheets you want to
group once grouped you only have to work on one sheet , when finished,
just click on any of the grouped sheet tabs and the sheets will ungroup
Dave

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Paste method fails in VBA


I am pasting to the same sheet more than 500 times. The code that I am
using is:

Range("A9:FY17").Select
Selection.Copy
curr = 9 * (i + 1)
Range("A" & curr).Select
Range("A" & curr) = i + 1
ActiveSheet.Paste
Application.CutCopyMode = False
Call ClearClipboard


--
lalu
------------------------------------------------------------------------
lalu's Profile: http://www.excelforum.com/member.php...o&userid=28055
View this thread: http://www.excelforum.com/showthread...hreadid=475665

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Paste method fails in VBA

Hi LaLu,
I tried to use your macr and ended up with an undefined variable, I
supose you are trying to get your next cell placement before you paste
again.
Here;s a simple macro for copy&paste:
Range("A9:FY17").copy Destination:=ActiveCell
Now if you get your loop right for your cell placement you can use the
above code before your next loop.
When you record a macro for your cell placement record it as relative
instead of absolute then your cell selection will go down the proper
number of rows you require.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Paste method fails in VBA

I will check in the morning to see how you have done< I have been doing
some reading have have a couple of ideas
dave

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
select method of range class fails mark kubicki Excel Programming 12 April 27th 05 02:37 PM
Chart location method fails using sheet name deko[_2_] Excel Programming 3 March 4th 05 02:54 PM
Workbooks.open method fails JAT Excel Programming 3 January 24th 05 08:19 PM
Select method of Range fails J West Excel Programming 1 June 7th 04 02:41 PM
Copy method fails in IIS Domien Excel Programming 0 February 19th 04 02:46 PM


All times are GMT +1. The time now is 08:37 AM.

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

About Us

"It's about Microsoft Excel"