ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   PasteSpecial (format only) Selection is too large (https://www.excelbanter.com/excel-programming/425443-pastespecial-format-only-selection-too-large.html)

Lolt

PasteSpecial (format only) Selection is too large
 
I was having a problem to a PasteSpecial (format only) for a few hundred
rows. I finally broke it up into smaller chunks, paste n rows at a time.
Currently doing it in two rows chunks works, but takes a long time.

Is there some way to determine, other than a binary search on chunk size,
how many rows can be pasted at a time. Note: cells involved have
conditional formatting and table formatting

Note: Excel automation project in C#

Shane Devenshire

PasteSpecial (format only) Selection is too large
 
Hi,

YOu should be able to do the entire range with one command, I tested on
65,000 rows without the slightest problem, here is the block of code I used:

Sub PasteFormat()
[A1].Copy
[A2:A65000].PasteSpecial Paste:=xlPasteFormats
End Sub

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Lolt" wrote:

I was having a problem to a PasteSpecial (format only) for a few hundred
rows. I finally broke it up into smaller chunks, paste n rows at a time.
Currently doing it in two rows chunks works, but takes a long time.

Is there some way to determine, other than a binary search on chunk size,
how many rows can be pasted at a time. Note: cells involved have
conditional formatting and table formatting

Note: Excel automation project in C#



All times are GMT +1. The time now is 03:40 PM.

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