copy row to new sheet where cell value meets criteria

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Please can you help me to define a macro to copy all rows in worksheet1 where
cell Ax does not contain value zero to worksheet2
 
Sub CopyNonZero()
Dim v
j = 1
For i = 1 to 65536
If Sheets("Sheet1").Cells(i,1) <> 0 Then
v = Sheets("Sheet1").Cells(i,1).EntireRow
Sheets("Sheet2").Cells(j,1).EntireRow = v
j = j + 1
End If
Next i
End Sub

HTH
Kostis Vezerides
 

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