Create Lists According to Group

User avatar
Joseph
3StarLounger
Posts: 206
Joined: 31 Dec 2010, 22:23
Location: Columbia Falls, MT

Create Lists According to Group

Post by Joseph »

I have an employee information user form that I'm using to enter employee information to a worksheet.

There are 5 different groups, so I want each group to have it's own list. What code could I use to (example) populate columns (H:N) with all the employees who are assigned to group (General)? I really want to avoid using the filter or copy pasting.

Here is a small example workbook.

H:N - General
O:U - Transporting
V:AB - Forklift Operator
AC:AI - Maintenance
AJ:AP - Team Lead
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78557
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Create Lists According to Group

Post by HansV »

You'll have to copy anyway, e.g.

Code: Select all

Sub CopyData()
  Dim rng As Range
  Application.ScreenUpdating = False
  Set rng = Range(Range("A1"), Range("A1").End(xlDown).Offset(0, 6))
  rng.Offset(0, 7).ClearContents
  rng.AutoFilter Field:=3, Criteria1:="General"
  rng.Copy Destination:=Range("H1")
  rng.AutoFilter
  Application.ScreenUpdating = True
End Sub
Best wishes,
Hans

User avatar
Joseph
3StarLounger
Posts: 206
Joined: 31 Dec 2010, 22:23
Location: Columbia Falls, MT

Re: Create Lists According to Group

Post by Joseph »

Works great, thanks Hans.