LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default PasteSpecial Paste:=ColumnWidths

Hi

When I record PasteSpecial operation as macro, I get a code like this:
Range(RangeToCopy).Select
Selection.Copy
Range(RangeToPaste).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False
Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False
Selection.PasteSpecial Paste:=xlColumnWidths, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

As I prefer to work wihout pouncing around with cursor, my code looks like
this instead:
Range(RangeToCopy).Copy
Range(RangeToPaste).PasteSpecial Paste:=xlValues
Range(RangeToPaste).PasteSpecial Paste:=xlFormats
' so long it works fine, but next row of code does fail
Range(RangeToPaste).PasteSpecial Paste:=xlColumnWidths

I think, that like with copying the validation, where I have to use an index
6 instead of optional variant's name , I need some index here too. Has
someone some knowledge about this - in Excel Help I didn't find anything
useful about this matter.

Thanks in advance

--
When sending mail, use address arvil<attarkon.ee
Arvi Laanemets


 
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
Cut, Copy, Paste, PasteSpecial grayed out. news.microsoft.com[_6_] Excel Discussion (Misc queries) 9 October 19th 17 08:45 PM
PasteSpecial Kevin Excel Programming 3 October 7th 04 01:07 PM
pastespecial in vba cornishbloke[_13_] Excel Programming 7 December 31st 03 01:02 PM
listbox.Columnwidths question Stuart[_5_] Excel Programming 1 September 21st 03 07:26 PM
Paste columnwidths in Xl2k problem Stuart[_5_] Excel Programming 3 September 4th 03 05:09 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"