ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copying too much. (https://www.excelbanter.com/excel-programming/291097-copying-too-much.html)

SS[_3_]

Copying too much.
 
The following code should copy Columns C and D from one
workbook to another one. However, it is copying columns
A, B, C, and D.

Windows("Work Orders - Master.xls").Activate
Sheets("Drum Prep").Select
Columns("C:D").Select
Selection.Copy

Windows("Form.xls").Activate
Sheets("Drum Prep Comparison").Select
Columns("D:D").Select
ActiveSheet.Paste


Any ideas on how to fix this quirk?

Thanks

SS

Ron Dahl[_2_]

Copying too much.
 
For whatever it's worth, I could not duplicate your problem. I modified the
code as shown below. In worksheet Test1, I put some information in Columns
A, B, C, and D
The procedure seemed to correctly copy the information from columns C and D
to columns D and E in test2. The information in Columns A and B of test1
was not copied.
It was with Office 2003 that I tried it.
Ron Dahl

Windows("Test1.xls").Activate
Sheets("Sheet1").Select
Columns("C:D").Select
Selection.Copy

Windows("Test2.xls").Activate
Sheets("Sheet2").Select
Columns("D:D").Select
ActiveSheet.Paste




"SS" wrote in message
...
The following code should copy Columns C and D from one
workbook to another one. However, it is copying columns
A, B, C, and D.

Windows("Work Orders - Master.xls").Activate
Sheets("Drum Prep").Select
Columns("C:D").Select
Selection.Copy

Windows("Form.xls").Activate
Sheets("Drum Prep Comparison").Select
Columns("D:D").Select
ActiveSheet.Paste


Any ideas on how to fix this quirk?

Thanks

SS





All times are GMT +1. The time now is 03:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com