I don't know why you need to add a row on sheet2. I wrote two similar
macros. the 1st doesn't add the row. The 2nd does insert a new row
Destrow = 1
with Sheets("Sheet1")
For RowCount = 3 to 17
Data = .range("D" & rowcount)
if Data 0 then
.Range("A" & RowCount & ":F" & Rowcount).copy _
Destination:=Sheets("Sheet2").range("A" & DestRow)
DestRow = DestRow + 1
End if
Next Rowcount
end with
2nd macro
Destrow = 2
with Sheets("Sheet1")
For RowCount = 3 to 17
Data = .range("D" & rowcount)
if Data 0 then
Sheets("Sheet2").rows(RowCount + 1).Insert
.Range("A" & RowCount & ":F" & Rowcount).copy _
Destination:=Sheets("Sheet2").range("A" & DestRow)
DestRow = DestRow + 1
End if
Next Rowcount
end with
'Original Source:
http://tinyurl.com/y84jecl
--
joel
------------------------------------------------------------------------
joel's Profile:
http://www.thecodecage.com/forumz/member.php?u=229
View this thread:
http://www.thecodecage.com/forumz/sh...d.php?t=194340
http://www.thecodecage.com/forumz