ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copying Columns (https://www.excelbanter.com/excel-programming/379263-re-copying-columns.html)

Bernie Deitrick

Copying Columns
 
R,

Worksheet("Sheet Name").Range("A:A").Copy Worksheets("Other Name").Range("A:A")
Worksheet("Sheet Name").Range("B:B").Copy Worksheets("Other Name").Range("D:D")
Worksheet("Sheet Name").Range("C:C").Copy Worksheets("Other Name").Range("G:G")

HTH,
Bernie
MS Excel MVP


"RSteph" wrote in message
...
Is there a quick and dirty way to copy an entire column from one worksheet,
and paste it into another (with a macro). For example I have a worksheet with
three columns. I'd like to paste column A of that worksheet into column A of
another, then column B into column D, and column C into column G.

As of now I'm using a for loop to run through the first worksheet, and then
doing a simple Cell("").Value = worksheet.Cell("").Value type of deal; but I
was curious if there was a simpler way to handle this: Some sort of
'worksheet(1).Columns("B").CopyTo(Worksheet(2).Col umns("D")' - Something
simple like that??

Is there and easier/more effecient way to handle this than to use a For Loop?





All times are GMT +1. The time now is 10:21 PM.

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