ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   copy row to new sheet where cell value meets criteria (https://www.excelbanter.com/excel-discussion-misc-queries/130480-copy-row-new-sheet-where-cell-value-meets-criteria.html)

djhs63

copy row to new sheet where cell value meets criteria
 
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

vezerid

copy row to new sheet where cell value meets criteria
 
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

On Feb 13, 5:45 pm, djhs63 wrote:
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





All times are GMT +1. The time now is 06:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com