Copy Rows using criteria

  • Thread starter Thread starter Carpe Diem
  • Start date Start date
C

Carpe Diem

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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top