Hi there fellow Excel users,
I'm stumped with this piece of VBA, specifically the "Selection.AutoFilter". If I have that statement "Selection.AutoFilter" in the first sheet, that sheet ends up and AutoFilter but not the second sheet. The strange thing is when I place the exact statement for the second sheet, both sheets don't end up with an AutoFilter.
Any ideas? And thank you in advance.
I'm stumped with this piece of VBA, specifically the "Selection.AutoFilter". If I have that statement "Selection.AutoFilter" in the first sheet, that sheet ends up and AutoFilter but not the second sheet. The strange thing is when I place the exact statement for the second sheet, both sheets don't end up with an AutoFilter.
Any ideas? And thank you in advance.
VBA Code:
Dim DbExtract, DuplicateRecords As Worksheet
Set DbExtract = ThisWorkbook.Sheets("Investigations")
Set DuplicateRecords = ThisWorkbook.Sheets("My team's investigations")
Sheets("Safety Accountability Dashboard").Select
Sheets("Investigations").Visible = True
Sheets("Investigations").Select
Sheets("My team's investigations").Visible = True
DbExtract.Range("A1:BF9999").SpecialCells(xlCellTypeVisible).Copy
DuplicateRecords.Cells(1, 1).PasteSpecial
Sheets("Investigations").Select
ActiveWindow.SelectedSheets.Visible = False
[QUOTE]
Selection.AutoFilter
[/QUOTE]
Selection.WrapText = True
Selection.HorizontalAlignment = xlLeft
Selection.VerticalAlignment = xlVAlignTop
Set DbExtract = ThisWorkbook.Sheets("Actions")
Set DuplicateRecords = ThisWorkbook.Sheets("My team's actions")
Sheets("Safety Accountability Dashboard").Select
Sheets("Actions").Visible = True
Sheets("Actions").Select
Sheets("My team's actions").Visible = True
DbExtract.Range("A1:BF9999").SpecialCells(xlCellTypeVisible).Copy
DuplicateRecords.Cells(1, 1).PasteSpecial
Sheets("Actions").Select
ActiveWindow.SelectedSheets.Visible = False
Selection.WrapText = True
Selection.HorizontalAlignment = xlLeft
Selection.VerticalAlignment = xlVAlignTop
[QUOTE]
Selection.AutoFilter
[/QUOTE]
Sheets("Report Creator").Select
ActiveWindow.SelectedSheets.Visible = False
Sheets("Safety Accountability Dashboard").Select