View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Excel 97: Copy Range with all formatting to another Sheet

Indeed it was introduced in XL2000 but it's not even documented in XL2000's
help at all

"Paste Optional Variant. The part of the range to be pasted. Can be one of
the following XlPasteType constants: xlPasteAll, xlPasteFormulas,
xlPasteValues, xlPasteFormats, xlPasteNotes, or xlPasteAllExceptBorders. The
default value is xlPasteAll."

This works in xl2k but fails in xl97
range.pastespecial paste:=xlPasteColumnWidths

However, in XL97 if entire columns are copied then Pastespecial formats will
paste column widths. That requires of course that the destination is one or
same number of columns as the source.

Regards,
Peter T


"Dave Peterson" wrote in message
...
I think xl2k added:
range.pastespecial paste:=xlPasteColumnWidths

And it even had a bug. MS didn't create that constant--except in the
help. In
xl2k, you would have to use:

range.pastespecial paste:=8



Peter T wrote:

"Mike Middleton" wrote in message

As I recall, in Excel 97, I had to use three separate Copy and Paste
commands: one for cell values, one for cell formats, and one for column
widths.


I'll stand corrected but I don't think Excel 97 has any facility to paste
column widths unless an entire sheet is copied to a new sheet. There is
of
course PasteSpecial that can paste values or formats and some other
things,
but not row/column dim's.

Regards,
Peter T


--

Dave Peterson