Hi All
Attached is a test workbook for my real life book I am trying to build.
Sheet 1 is a team of employees by Title, Name and their allocated Team. This list in reality is over 100 employees long! In addition, there is a time sheet that shows there whereabouts by each day, with differing colours for differing places they may be.
I want to pull that data to form the Team Sheets on the other worksheet.
I have made a Macro that basically filters the list by teams, and copies to the second sheet. However this Macro fails.
Macro is as such:
========================================
============================================
Can anyone help? I think it might be possible with either separate Macros for each team, of HLookup or VLookup, but I am a little lost on these.
Many thanks in advance
Matt
Attached is a test workbook for my real life book I am trying to build.
Sheet 1 is a team of employees by Title, Name and their allocated Team. This list in reality is over 100 employees long! In addition, there is a time sheet that shows there whereabouts by each day, with differing colours for differing places they may be.
I want to pull that data to form the Team Sheets on the other worksheet.
I have made a Macro that basically filters the list by teams, and copies to the second sheet. However this Macro fails.
Macro is as such:
========================================
Code:
Sub Macro3()
'
' Macro3 Macro
'
'
ActiveSheet.Range("$A$3:$AF$9").AutoFilter Field:=3, Criteria1:="Team1"
Range("A:B,E:K").Select
Range("E1").Activate
Selection.Copy
Sheets("Sheet5").Select
ActiveSheet.Paste
Range("J1").Select
Sheets("Sheet1").Select
ActiveSheet.Range("$A$3:$AF$9").AutoFilter Field:=3, Criteria1:="Team2"
Range("A:B,E:K").Select
Range("E1").Activate
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet5").Select
ActiveSheet.Paste
Range("S1").Select
Sheets("Sheet1").Select
ActiveSheet.Range("$A$3:$AF$9").AutoFilter Field:=3, Criteria1:="Team3"
Range("A:B,E:K").Select
Range("E1").Activate
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet5").Select
ActiveSheet.Paste
Range("P17").Select
Sheets("Sheet1").Select
ActiveSheet.Range("$A$3:$AF$9").AutoFilter Field:=3
End Sub
Can anyone help? I think it might be possible with either separate Macros for each team, of HLookup or VLookup, but I am a little lost on these.
Many thanks in advance
Matt
Attachments
Last edited by a moderator: