ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy/Paste Column Issue Using a Range (https://www.excelbanter.com/excel-programming/397279-copy-paste-column-issue-using-range.html)

ALATL

Copy/Paste Column Issue Using a Range
 
I am trying to copy several columns to a new worksheet. I have the following
code that does not copy the entire column correctly. It seems to copy only
cells C1 to C4. There are empty spaces in this column.

I would like for this to copy beginning at Org_Addr (this can be a variable
location) and all the way down to the last row of data in this column.

I appreciate the help!

ALATL

With SourceSheet
.Range(.Range(Org_Addr), .Range(Org_Addr).End(xlDown)).Copy
End With
DestSheet.[C65536].End(xlUp)(1).PasteSpecial Paste:=xlValues

JE McGimpsey

Copy/Paste Column Issue Using a Range
 
One way:

With SourceSheet
With .Range(.Range(Org_Addr), .Cells(.Rows.Count, _
.Range(Org_Addr).Column).End(xlUp))
DestSheet.Cells(.Rows.Count, 3).End(xlUp).Resize( _
.Rows.Count, .Columns.Count).Value = .Value
End With
End With





In article ,
ALATL wrote:

I am trying to copy several columns to a new worksheet. I have the following
code that does not copy the entire column correctly. It seems to copy only
cells C1 to C4. There are empty spaces in this column.

I would like for this to copy beginning at Org_Addr (this can be a variable
location) and all the way down to the last row of data in this column.

I appreciate the help!

ALATL

With SourceSheet
.Range(.Range(Org_Addr), .Range(Org_Addr).End(xlDown)).Copy
End With
DestSheet.[C65536].End(xlUp)(1).PasteSpecial Paste:=xlValues


ALATL

Copy/Paste Column Issue Using a Range
 
It worked! However, I have no idea why. Can you do me a favor & put this into
English for me?

I appreciate your answer!

Best,
ALATL

"JE McGimpsey" wrote:

One way:

With SourceSheet
With .Range(.Range(Org_Addr), .Cells(.Rows.Count, _
.Range(Org_Addr).Column).End(xlUp))
DestSheet.Cells(.Rows.Count, 3).End(xlUp).Resize( _
.Rows.Count, .Columns.Count).Value = .Value
End With
End With





In article ,
ALATL wrote:

I am trying to copy several columns to a new worksheet. I have the following
code that does not copy the entire column correctly. It seems to copy only
cells C1 to C4. There are empty spaces in this column.

I would like for this to copy beginning at Org_Addr (this can be a variable
location) and all the way down to the last row of data in this column.

I appreciate the help!

ALATL

With SourceSheet
.Range(.Range(Org_Addr), .Range(Org_Addr).End(xlDown)).Copy
End With
DestSheet.[C65536].End(xlUp)(1).PasteSpecial Paste:=xlValues




All times are GMT +1. The time now is 04:41 AM.

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