![]() |
#2
|
||||
|
||||
![]()
I'm not sure why it would stop running but it might be because you are comparing a range with a number. Also, I would copy the row to a the first cell rather than to an entire row. Try this
Code:
Sub Transfer_Summary_Detail() Dim c As Range, j As Integer Dim Source As Worksheet, Target As Worksheet Set Source = ActiveWorkbook.Worksheets("Summary") ' Change worksheet designations as needed Set Target = ActiveWorkbook.Worksheets("Sheet1") j = 4 ' Start copying to 4th row in target sheet For Each c In Source.Range("P4:P4000") ' Do 4000 rows If c.Value <> 0 Then Source.Rows(c.Row).Copy Target.Range("A" & j) j = j + 1 End If Next c End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Noah14 | Excel Programming | 1 | 09-19-2014 11:46 PM |
![]() |
Gerreth | Outlook | 3 | 03-13-2012 05:06 AM |
Partially Obscure Video in PowerPoint | KBsay | PowerPoint | 0 | 10-05-2010 12:49 PM |
Problems working in a partially protected document | Autumn | Excel | 0 | 02-11-2009 03:46 PM |
Drawing partially off printed page | DLRA | Visio | 0 | 09-26-2006 10:40 AM |