Currently I have a form on a workbook that has a command that runs vb that will copy all the contents from all the worksheets and copy/paste into a worksheet titled "summary". I need to add to that vb to exclude a worksheet labeled "users". I also need to check that duplicate rows do not get entered into the "summary" page when copied.
How could I add this?
Thanks!
Code:
Private Sub cmdSummary_Click()
Dim LastRow As Long, r As Long
Sheets("Summary").Activate
LastRow = ActiveSheet.UsedRange.Rows.Count
For Each Sheet In Sheets
If Sheet.Index <> 1 Then
RowCount = Sheet.UsedRange.Rows.Count
Sheet.UsedRange.Copy Destination:=Sheets("Summary").Cells(LastRow + 1, 1)
LastRow = LastRow + RowCount
Sheet.UsedRange.Clear
End If
LastRow = ActiveSheet.UsedRange.Row - 1 + ActiveSheet.UsedRange.Rows.Count
Application.ScreenUpdating = False
For r = LastRow To 1 Step -1
If Application.CountA(Rows(r)) = 0 Then Rows(r).Delete
Next r
Application.ScreenUpdating = True
Next Sheet
End Sub
How could I add this?
Thanks!