PasteSpecial

paulyf

New Member
Joined
Mar 27, 2002
Messages
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
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
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
 
Upvote 0
Being stupid - constant just follows tab order in Paste Special box!!

Problem resolved - Many Thanks
 
Upvote 0

Forum statistics

Threads
1,214,400
Messages
6,119,288
Members
448,885
Latest member
LokiSonic

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top