Sorry for the delay... Try this code
Sub Sheets321()
Dim x As Long
Dim y As Long
Dim z As Long
Dim lRow As Long
Dim vD As Variant
Dim vR As Variant
Dim rRow As Range
'COLLECT DATA
With Worksheets.Add(Sheets(1))
.Name = "One"
For x = 1 To Worksheets.Count
If Worksheets(x).Name <> "One" Then
lRow = .Cells.SpecialCells(xlCellTypeLastCell).Row + 1
vD = Worksheets(x).UsedRange.Value2
.Cells(lRow, 1).Resize(UBound(vD, 1), UBound(vD, 2)) = vD
End If
Next x
.Columns("c:c").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
.Cells.SpecialCells(xlCellTypeBlanks).Delete (xlShiftToLeft)
vD = .UsedRange.Value2
'SEARCH AND COPY DATA
ReDim vR(1 To UBound(vD), 1 To 4)
lRow = 0
For x = 1 To UBound(vD)
If vD(x, 1) = "User Name:" Then
y = 0
Do
y = y + 1
If y + x > UBound(vD) Then Exit Do
Loop Until vD(x + y, 1) = "User Name:" Or Len(vD(x + y, 1)) = 0
For z = 1 To y - 1
If vD(x + z, 1) <> "Total" And vD(x + z, 1) <> "Queue" Then
lRow = lRow + 1
vR(lRow, 1) = vD(x, 2) 'COPY USER NAME
vR(lRow, 2) = vD(x + z, 1) 'COPY QUEUE NAME
vR(lRow, 3) = Format(vD(x + z, 5), "0") 'COPY TOTAL CHATS
vR(lRow, 4) = Format(vD(x + z, 8), "hh:mm:ss") 'COPY TOTAL TIME
End If
Next z
End If
Next x
'POST RESULTS
.Cells.Delete
.Cells(1, 1).Resize(UBound(vR, 1), UBound(vR, 2)) = vR
End With
End Sub
HTH,
Rich
Bookmarks