PasteSpecial

K

KL

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
 
J

Jim Rech

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
|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
 
Top