I have a workbook of different items being worked on spread across multiple sheets. In column E of all sheets there is a drop down so all the rows will be Pending, Complete, or blank. I want a last sheet that will generate a list of all the items from all the sheets in the pending state. So upon button click I want any item in the pending state to have its entire row copied to the list page. Also I want this button click to clear the contents of the sheet below row 1 and then begin regenerating the list every time its executed. (Row 1 is for headers and the button) Following completion I want a display box to say it is complete and have as close button. My code thus far is posted below I have tried a bunch of changes but keep yielding errors. Any help or guidance would be greatly appreciated.
Private Sub CommandButton1_Click()
Dim Pending As Worksheet
Pending.Cells.ClearContents
Sheets("Sheet1", "Sheet2").Rows(1).Copy
Pending.Range("A2").Insert shift:=x1Down
With Sheets("Sheet1", "Sheet2")
For r = 1 To CInt(Sheets("Sheet1", "Sheet2").Range("A65536").End(xlUp).Row)
If Sheets("Sheet1", "Sheet2").Cells(r, 1) = Pending Then
Sheets("Sheet1", "Sheet2").Rows(r).Copy
Pending.Range("A65536").End(xlUp).Offset(1).PasteSpecial
End If
Next
End With
Application.CutCopyMode = False
Pending.Activate
Response = MsgBox("Pending List Complete", vbClose)
If Response = vbClose Then
Unload Me
End If
End Sub
Bookmarks