Sub aaa()
Dim AD As Long, TNOA As Long, EN As Long, FED As Long, LastCol As Long
Set dic = CreateObject("Scripting.dictionary")
AD = WorksheetFunction.Match("Approved Date", Rows("1:1"), 0)
TNOA = WorksheetFunction.Match("Total Number of Attendees", Rows("1:1"), 0)
EN = WorksheetFunction.Match("Employee Name", Rows("1:1"), 0)
FED = WorksheetFunction.Match("Full Expense Dollars", Rows("1:1"), 0)
LastCol = Cells(1, Columns.Count).End(xlToLeft).Column
Application.ScreenUpdating = fause
For i = 2 To Cells(Rows.Count, AD).End(xlUp).Row
If Not dic.exists(Cells(i, AD) & "," & Cells(i, TNOA) & "," & Cells(i, FED)) Then
dic.Add Item:=Cells(i, AD) & "," & Cells(i, TNOA) & "," & Cells(i, FED) & "," & i, Key:=Cells(i, AD) & "," & Cells(i, TNOA) & "," & Cells(i, FED)
Else
arr = Split(dic(Cells(i, AD) & "," & Cells(i, TNOA) & "," & Cells(i, FED)), ",")
Cells(arr(3), EN).Value = Cells(arr(3), EN).Value & "; " & Cells(i, EN)
Cells(i, 1).Resize(1, LastCol).ClearContents
End If
Next i
For i = Cells(Rows.Count, AD).End(xlUp).Row To 2 Step -1
If Len(Cells(i, 1)) = 0 Then Cells(i, 1).EntireRow.Delete shift:=xlUp
Next i
Application.ScreenUpdating = True
End Sub
rylo
Bookmarks