Sub DepartmentList()
'ASSIGN DEPARTMENTS BASED ON MANAGER
Dim intDepartmentColumn As Integer
Rows("1:1").Select
intDepartmentColumn = Selection.Find(what:="Department", After:=ActiveCell, LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False).Column
Rows("1:1").Select
Selection.Find(what:="Manager", After:=ActiveCell, LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False).Select
Selection.Offset(1, 0).Select
Range(ActiveCell, Cells(ActiveSheet.UsedRange.Rows.Count, 17)).Select
For Each cell In Selection.Cells
Select Case cell.Value
Case "Thuan Tran", "Deborah Donoghue", "Edmond Albert Navarro", "Christopher Arndt-Kohlway", "Chris Arndt-Kohlway", "Efren Saraza", "Rajesh Raghavendran", "Troy Rudy", "Colin Fraser", "Timothy Gleadle"
Cells(cell.Row, intDepartmentColumn) = "IT Operations"
Case "Daniel Singleton", "Paul Brockman", "Stuart Johnston", "Darren Walton"
Cells(cell.Row, intDepartmentColumn) = "IS End User Computing"
Case "John Goodreau", "Timothy Westcott", "Krishnan Balasubramanian", "Asheesh Chhabra", "Eric Keller", "Michael Galiardi", "Michel Roberge", "Mathew Griffin"
Cells(cell.Row, intDepartmentColumn) = "SDD"
Case "Jeffrey Kase"
Cells(cell.Row, intDepartmentColumn) = "Information Assurance"
Case "Venkatesh Appiya", "Anup Samantaray", "Lisa Rosenfeld"
Cells(cell.Row, intDepartmentColumn) = "Program Management"
Case "Kavitha Ravella"
Cells(cell.Row, intDepartmentColumn) = "ITSM"
Case "Jennifer Carr", "Dale Todd"
Cells(cell.Row, intDepartmentColumn) = "ITCM"
Case Else
Cells(cell.Row, intDepartmentColumn) = "MISC"
End Select
Next
End Sub
The format of excel sheet is as follows. (headings)
Bookmarks