Forum Discussion
DawnT1967
Aug 22, 2022Copper Contributor
Partial list needed
Hello, I have a list with the general work population and their qualifications. I need to filter the data on separate pages according to department. A pivot doesn't meet requirements. I need som...
OliverScheurich
Aug 22, 2022Gold Contributor
Sub department()
Dim i As Long
Dim k As Long
Dim l As Long
l = Range("A" & Rows.Count).End(xlUp).Row
For i = 2 To l
k = Worksheets("Department " & Cells(i, 1).Value).Range("A" & Rows.Count).End(xlUp).Row
Range(Cells(i, 1), Cells(i, 5)).Copy Destination:=Worksheets("Department " & Cells(i, 1).Value).Cells(k + 1, 1)
Next i
End SubMaybe with this code. In the attached file you can click the button in cell H2 to run the macro.