excelwillmakemerich
New Member
- Joined
- Nov 12, 2019
- Messages
- 1
Hi to all,
I am a newbie and is learning a lot from this site. I am also hoping that someone can help me with my problem with the VBA code I created via recording a macro.
I have a 9 column master data that I need to filter based on column C "Department" there are times that two departments needs to be group in one sheet together.
I have a 2 row header, row1 and row 2 (see image Sample_MasterData.gif) attached.
I created a tab for each department that I need to group and just record a macro below, but the output seems to duplicate the column D, E & F to column G, H & I (see attached image Capture.gif). Column H & I has a data validation list Col H - RED, YELLOW, GREEN and Col I as - At Risk, On Track.
I really hope someone can help me. Thank you all in advance.
I am a newbie and is learning a lot from this site. I am also hoping that someone can help me with my problem with the VBA code I created via recording a macro.
I have a 9 column master data that I need to filter based on column C "Department" there are times that two departments needs to be group in one sheet together.
I have a 2 row header, row1 and row 2 (see image Sample_MasterData.gif) attached.
I created a tab for each department that I need to group and just record a macro below, but the output seems to duplicate the column D, E & F to column G, H & I (see attached image Capture.gif). Column H & I has a data validation list Col H - RED, YELLOW, GREEN and Col I as - At Risk, On Track.
I really hope someone can help me. Thank you all in advance.
VBA Code:
Sub AutoFilter2()
'
' AutoFilter2 Macro
' AutoFilter2
'
'
Range("A2").Select
Sheets("Approved EXC Inventory (2)").Range("A2:I40").AdvancedFilter Action:= _
xlFilterCopy, CriteriaRange:=Sheets("LIST").Range("C2:C4"), CopyToRange:= _
Range("A2"), Unique:=False
ActiveWindow.SmallScroll Down:=-12
Sheets("Approved EXC Inventory (2)").Select
ActiveWindow.SmallScroll Down:=-12
Rows("1:1").Select
Selection.Copy