ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy only where data ends in column (https://www.excelbanter.com/excel-programming/323116-copy-only-where-data-ends-column.html)

Pat

Copy only where data ends in column
 
Is it possible to copy a range to where the data ends in a column.

For example the range:
Range("D8:J900").Select
Selection.Copy

If the data ends in D822 then can only data in the range:
Range("D8:J822").Select
Selection.Copy

be copied and at the same time ignore the formulas contained in each and all
of the cells within the range?

Is this possible?

Much appreciate if someone could let me know.
Pat




Jim Thomlinson[_3_]

Copy only where data ends in column
 
I hope I understood your question correctly. You want to copy all of the
non-formula itmes in range D8 through J900. You also wanted to select only up
to the last row. Since anything after the last row is not a formula you can
ignore this. Here is my implimentation of your code. To get this in a macro
Select the range - Hit F5 - Choose Special - choose constants - Choose OK

Sheets("Sheet1").Range("D8:J900").SpecialCells(xlC ellTypeConstants).Copy

HTH

"Pat" wrote:

Is it possible to copy a range to where the data ends in a column.

For example the range:
Range("D8:J900").Select
Selection.Copy

If the data ends in D822 then can only data in the range:
Range("D8:J822").Select
Selection.Copy

be copied and at the same time ignore the formulas contained in each and all
of the cells within the range?

Is this possible?

Much appreciate if someone could let me know.
Pat





Pat

Copy only where data ends in column
 
Thank you for replying. The solution I am looking for is different to your
suggestion. I want to be able to copy a range where the range can
automatically alter to only copy where data ends in column "D" If the data
in column "D" happens to end in D822 then only copy to D822. So rather than
copy D8:J900 and do what you suggest:
Select the range - Hit F5 - Choose Special - choose constants - Choose

OK
I would only want to copy D8:J822

Pat


"Jim Thomlinson" wrote in message
...
I hope I understood your question correctly. You want to copy all of the
non-formula itmes in range D8 through J900. You also wanted to select only

up
to the last row. Since anything after the last row is not a formula you

can
ignore this. Here is my implimentation of your code. To get this in a

macro
Select the range - Hit F5 - Choose Special - choose constants - Choose

OK

Sheets("Sheet1").Range("D8:J900").SpecialCells(xlC ellTypeConstants).Copy

HTH

"Pat" wrote:

Is it possible to copy a range to where the data ends in a column.

For example the range:
Range("D8:J900").Select
Selection.Copy

If the data ends in D822 then can only data in the range:
Range("D8:J822").Select
Selection.Copy

be copied and at the same time ignore the formulas contained in each and

all
of the cells within the range?

Is this possible?

Much appreciate if someone could let me know.
Pat








All times are GMT +1. The time now is 08:45 AM.

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