Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Pat Pat is offline
external usenet poster
 
Posts: 122
Default 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



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default 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




  #3   Report Post  
Posted to microsoft.public.excel.programming
Pat Pat is offline
external usenet poster
 
Posts: 122
Default 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






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 data import wizard does not support line ends in fields ChrisLime Excel Discussion (Misc queries) 0 February 25th 09 12:07 PM
setting worksheet so it ends at last data entry in column sam New Users to Excel 2 November 19th 08 09:26 PM
Area chart display ENDS before data ? Boswell Charts and Charting in Excel 0 January 1st 08 06:16 PM
filter using "ends with" and 3 choices? Ex: ends with 1,2 or3 Debbie Excel Worksheet Functions 1 April 6th 07 12:07 AM
Data string ends up in first cell instead of Comma sepaerated CSV format Katherine[_3_] Excel Programming 2 September 27th 03 06:24 PM


All times are GMT +1. The time now is 04:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"