View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Conditionally copy from multiple sheets to one sheet

The code below wil check every sheet in the workbook in the range "A1:D15"
for a blnak cell and if it find one copies the endtire row to a new worksheet
called Blanks.

Sub findblanks()

Segment = "A1:d15"
Set NewSht = Sheets.Add(after:=Sheets(Sheets.Count))
NewSht.Name = "Blanks"
NewRowCount = 1
For Each sht In Sheets
If sht.Name < "Blanks" Then
Set SearchRange = sht.Range(Segment)
For RowCount = 1 To SearchRange.Rows.Count
For ColCount = 1 To SearchRange.Columns.Count
If SearchRange.Cells(RowCount, ColCount) = "" Then
SearchRange.Rows(RowCount).Copy _
Destination:=NewSht.Rows(NewRowCount)
NewRowCount = NewRowCount + 1
Exit For
End If
Next ColCount
Next RowCount
End If
Next sht
End Sub


"Pam" wrote:

Hi,

I have a workbook with several sheets for each employee. There is a segment
in the same section of each worksheet that contains a list of items with a
completed date. What I would like to happen is if the completed blank is
null anywhere in each list, that item with the due date to be placed on a
new worksheet - as a summary of all incomplete items for each employee. Is
this possible? I do not have any code to supply, as I don't even know where
to begin.

I would greatly appreciate any help with this.
Thanks in advance,
Pam