Create a Macro that will copy the rows that have a value <> 0

W

wil4d

How do I Create a Macro that will copy the rows that have a value <> 0 and
paste them on anther worksheet
 
C

Chip Pearson

Try something like the following. Change the lines marked with <<
to the appropriate ranges.

Dim DestRng As Range
Dim Rng As Range

Set DestRng = Worksheets("Sheet2").Range("A1") '<<
For Each Rng In Range("A1:A10") '<<
If Rng.Value <> "" Then
Rng.EntireRow.Copy Destination:=DestRng
Set DestRng = DestRng(2, 1)
End If
Next Rng


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Top