ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   PasteSpecial (https://www.excelbanter.com/excel-programming/303530-pastespecial.html)

KL[_3_]

PasteSpecial
 
I want to copy the format of 2 cells to the rest of the worksheet using
PasteSpecial. It works for a small range, but when I copy it to a bigger
range of cells I get a runtime error 1004 "Markierung ist zu gross"
which can be translatet to "Selection too big".
Even when I use a small range and try to copy it in a loop I get this
error after some sucellfull copies. Is there some kind of copy buffer
that has to be deleted?

Here is my code with just a small destination range that works

xlWs.Range("C2:C3").Select
xlApp.Selection.Copy
xlWs.Range("C2:W11").Select
xlApp.Selection.PasteSpecial Paste:=xlPasteFormats, _
Operation:=xlNone, SkipBlanks:=False, Transpose:=False
xlApp.CutCopyMode = False

When I increase the destination range from C2:W11 for example to
C2:W3000 I get the error.

Thanks,
Karl
Please reply to newsgroup, not e-mail

Jim Rech

PasteSpecial
 
Curious. When I run this code, which pastes to a much larger range, I get
no error.

Range("A1:A2").Copy
Range("A1:IV65536").PasteSpecial xlPasteFormats


--
Jim Rech
Excel MVP
"KL" wrote in message
...
|I want to copy the format of 2 cells to the rest of the worksheet using
| PasteSpecial. It works for a small range, but when I copy it to a bigger
| range of cells I get a runtime error 1004 "Markierung ist zu gross"
| which can be translatet to "Selection too big".
| Even when I use a small range and try to copy it in a loop I get this
| error after some sucellfull copies. Is there some kind of copy buffer
| that has to be deleted?
|
| Here is my code with just a small destination range that works
|
| xlWs.Range("C2:C3").Select
| xlApp.Selection.Copy
| xlWs.Range("C2:W11").Select
| xlApp.Selection.PasteSpecial Paste:=xlPasteFormats, _
| Operation:=xlNone, SkipBlanks:=False, Transpose:=False
| xlApp.CutCopyMode = False
|
| When I increase the destination range from C2:W11 for example to
| C2:W3000 I get the error.
|
| Thanks,
| Karl
| Please reply to newsgroup, not e-mail




All times are GMT +1. The time now is 07:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com