Copy entire column

S

Sandman

I am trying to Copy the entire column from one sheet in a workbook to
another sheet in the same workbook I have tried the following Code:
--

Sub CopyYear1()
Workbooks("Book1.xls").Sheets("Sheet1").Range("A").Copy _
Workbooks("Book1.xls").Sheets("Sheet2").Range("A")
End Sub

And I get a run time error '9' when I run it. I am a newbie when it comes
to code any help would be appreciated.

Thanks



Darrin Sand
Project Manager
MEC Services Inc
Phone: 701-337-5404
Cell: 701-240-4000
email: [email protected]
 
R

Ron de Bruin

Use this Sandman

Sub CopyYear1()
Workbooks("Book1.xls").Sheets("Sheet1").Columns("A").Copy _
Workbooks("Book1.xls").Sheets("Sheet2").Columns("A")
End Sub
 
G

Gord Dibben

Darren

Sub Copy_A()
Worksheets("Sheet1").Range("A:A").Copy _
Destination:=Worksheets("Sheet2").Range("A:A")
End Sub

Within the same workbook, you don't need the [Book1.xls]

Gord Dibben Excel MVP
 
D

Don Guillett

try columns(1) instead of range("a")
or something like this
Sheets("sheet1").Columns("a:a").Copy Sheets("sheet2").Range("a1")
 
Top