#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Copy range

I have copied data from several excel sheets to a summary sheet, but
it contains data that I don't want included. On the summary sheet, I
would like to copy only the rows of data that do not include a zero in
column K of that row over to another area of that sheet. This area
would then display only the data I want to see without any spaces
between rows where the missing data would have been.

Is there an easy way to do this?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Copy range

Sub copy_non_zero()

LastRow = Range("K" & Rows.Count).End(xlUp).Row
NewRowCount = 1
For RowCount = 1 To LastRow
If Range("K" & RowCount) < 0 Then
Set SourceRange = Range("A" & RowCount & ":K" & _
RowCount)

SourceRange.Copy Destination:= _
Range("AA" & NewRowCount)

NewRowCount = NewRowCount + 1
End If
Next RowCount
End Sub


" wrote:

I have copied data from several excel sheets to a summary sheet, but
it contains data that I don't want included. On the summary sheet, I
would like to copy only the rows of data that do not include a zero in
column K of that row over to another area of that sheet. This area
would then display only the data I want to see without any spaces
between rows where the missing data would have been.

Is there an easy way to do this?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Copy range

On Dec 22 2007, 7:07*pm, Joel wrote:
Sub copy_non_zero()

LastRow = Range("K" & Rows.Count).End(xlUp).Row
NewRowCount = 1
For RowCount = 1 To LastRow
* *If Range("K" & RowCount) < 0 Then
* * * Set SourceRange = Range("A" & RowCount & ":K" & _
* * * * *RowCount)

* * * SourceRange.Copy Destination:= _
* * * * *Range("AA" & NewRowCount)

* * * NewRowCount = NewRowCount + 1
* *End If
Next RowCount
End Sub



" wrote:
I have copied data from several excel sheets to a summary sheet, but
it contains data that I don't want included. *On the summary sheet, I
would like to copy only the rows of data that do not include a zero in
column K of that row over to another area of that sheet. *This area
would then display only the data I want to see without any spaces
between rows where the missing data would have been.


Is there an easy way to do this?- Hide quoted text -


- Show quoted text -


Joel,

I just recently had a chance to review your response.

Thanks for your help.

Frank
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
RANGE EXCEL copy cell that meets criteria in a range confused Excel Worksheet Functions 3 March 27th 08 01:41 PM
copy formulas from a contiguous range to a safe place and copy them back later Lucas Budlong Excel Programming 2 February 22nd 06 08:26 PM
Create/copy combo boxes in one range if condition is met in a different range LB[_4_] Excel Programming 4 September 30th 05 12:21 AM
Code to copy range vs Copy Entire Worksheet - can't figure it out Mike Taylor Excel Programming 1 April 15th 04 08:34 PM
Range COPY function - how to copy VALUES and not formulas James Cooke Excel Programming 1 August 21st 03 07:04 PM


All times are GMT +1. The time now is 03:44 AM.

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"