![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Location: Paul
Posts: 34
|
Hi all,
I want to copy from one workbook and paste special "column widths" and "values" into another workbook. My crude code currently reads: Range("A8:M48").Select Selection.Copy Windows("Book1").Activate Sheets("Sheet3").Select ActiveSheet.PasteSpecial_ Paste:=xlColumnWidths ActiveSheet.PasteSpecial Paste:=xlValues Anybody tell me where I'm going wrong? As always, patience and help much appreciated! Cheers - Paul |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
|
Select the cell to paste to 1st
eg [A1].pastespecial paste:=8 NB: Don't USE paste:=xlcolumnwidths Use the Constant 8 or Define the xlwidths as; Const Xlcolumnwidths = 8 |
|
|
|
|
|
#3 |
|
New Member
Join Date: Mar 2002
Location: Paul
Posts: 34
|
Thanks a lot Ivan.
What's the constant for paste special "values"? Cheers - Paul |
|
|
|
|
|
#4 |
|
New Member
Join Date: Mar 2002
Location: Paul
Posts: 34
|
|
|
|
|
|
|
#5 |
|
New Member
Join Date: Mar 2002
Location: Paul
Posts: 34
|
Being stupid - constant just follows tab order in Paste Special box!!
Problem resolved - Many Thanks |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|