Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
select method of range class fails | Excel Programming | |||
Chart location method fails using sheet name | Excel Programming | |||
Workbooks.open method fails | Excel Programming | |||
Select method of Range fails | Excel Programming | |||
Copy method fails in IIS | Excel Programming |