Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default PasteSpecial column widths with different size ranges

If I perform:

Range("B7:E7").Copy
Range("B11:N11").PasteSpecial xlPasteFormats,
xlPasteSpecialOperationNone, False, False

Then the formatting from my four source cells is replicated across my
thirteen target cells. The first four cells are formatted, then the
second four, the third four and finally the last one. I like this
behavior.

However if instead I perform:

Range("B7:E7").Copy
Range("B11:N11").PasteSpecial xlPasteColumnWidths,
xlPasteSpecialOperationNone, False, False

I don't get the same repeating behavior across my target cells. The
first four cells get their column widths adjusted but the remaining
nine cells get no change to their column widths.

Is this a bug (I'm using XL2007)?

Can anybody think of a clever way around this short of looping? In
general I don't know in advance either the size of the source or
target ranges.

TIA,

josh
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default PasteSpecial column widths with different size ranges

I'm guessing that if you reported it to Microsoft as a bug, they would come
back and tell you that it is by design. In one case you are applying the
entire format object of a range to another range, although larger.
In the other case you are applying a format property and it will only allow
transfer to a range of equal or smaller scope.

There are a lot of things that appear to be bugs, that are in fact by
design.


"Josh Sale" wrote in message
...
If I perform:

Range("B7:E7").Copy
Range("B11:N11").PasteSpecial xlPasteFormats,
xlPasteSpecialOperationNone, False, False

Then the formatting from my four source cells is replicated across my
thirteen target cells. The first four cells are formatted, then the
second four, the third four and finally the last one. I like this
behavior.

However if instead I perform:

Range("B7:E7").Copy
Range("B11:N11").PasteSpecial xlPasteColumnWidths,
xlPasteSpecialOperationNone, False, False

I don't get the same repeating behavior across my target cells. The
first four cells get their column widths adjusted but the remaining
nine cells get no change to their column widths.

Is this a bug (I'm using XL2007)?

Can anybody think of a clever way around this short of looping? In
general I don't know in advance either the size of the source or
target ranges.

TIA,

josh



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
Different widths for each column in a 100% stacked column chart Chart Explorer Charts and Charting in Excel 1 May 21st 09 09:19 AM
Can I have different column widths below each other Dizzy Des New Users to Excel 3 February 8th 07 12:52 PM
How do I segment a column of data into size ranges in Excel? Motown Mick Excel Discussion (Misc queries) 15 August 28th 06 11:04 PM
Different column widths Holyhabanero Excel Worksheet Functions 2 January 18th 06 06:17 PM
Problem with speed of PasteSpecial for large ranges xlb[_2_] Excel Programming 4 February 20th 05 12:18 PM


All times are GMT +1. The time now is 04:45 PM.

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"