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: (e-mail address removed)
 
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")
 
S

Sandman

Thanks, I did get it to work

--





Darrin Sand
Project Manager
MEC Services Inc
Phone: 701-337-5404
Cell: 701-240-4000
email: (e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top