PC Review


Reply
Thread Tools Rate Thread

Copy Rows using criteria

 
 
Carpe Diem
Guest
Posts: n/a
 
      17th Dec 2007
Hi ,

I have a data with about 4500 rows and 12 columns. I would like to
copy only the rows where column C haven't "0" value.can someone hep me
with a macro ?


Example

Thank you
 
Reply With Quote
 
 
 
 
Dan R.
Guest
Posts: n/a
 
      17th Dec 2007
Try this:

Sub Copy()
Dim lRow As Long, rng As Range, i As Range
lRow = Range("C65536").End(xlUp).Row
Set rng = Range(Cells(1, 3), Cells(lRow, 3))

a = 1
For Each i In rng
If i.Value <> "0" Then
i.EntireRow.Copy Sheets(2).Rows(a)
a = a + 1
End If
Next i
End Sub

--
Dan

On Dec 17, 10:46 am, Carpe Diem <rmgalv...@gmail.com> wrote:
> Hi ,
>
> I have a data with about 4500 rows and 12 columns. I would like to
> copy only the rows where column C haven't "0" value.can someone hep me
> with a macro ?
>
> Example
>
> Thank you


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Rows Based On Criteria Sean Microsoft Excel Programming 3 23rd Mar 2010 10:03 PM
Copy rows between two criteria bpotter Microsoft Excel Programming 4 13th Jan 2009 06:53 PM
Automatically copy rows based on criteria =?Utf-8?B?SmF5?= Microsoft Excel Misc 5 9th Nov 2007 07:55 PM
Copy rows that meet a certain criteria James Microsoft Excel Programming 1 5th May 2006 11:31 PM
Copy Rows if Lookup Criteria Match =?Utf-8?B?dmRvdWJsZXU=?= Microsoft Excel Misc 0 29th Mar 2005 06:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:48 PM.