Hi folks.
Having trouble with this issue and need some advice/direction.
Attached is a spreadsheet showing an example task breakdown.
I'm looking to be able to filter out the task elements, and then hide the columns which have just had the filter applied.
I'm looking to create a macro for each of the buttons on the screen which goes into the auto filter on the task elements column and selects only blanks (thus hiding any record of a task element) and then hiding that column once the filter has been applied.
I've managed to record a macro of the opposite action, however when I record the aforementioned action, it hides all columns with information in it.
Below are both VBA scripts for reference:
Any help on this would be greatly appreciated. In my real working document it is not only column C that I need to hide. There may be many columns of task elements so a bit of direction in how to edit the code to apply to other sheets would be great.![]()
Sub Hide_TE() ' ' Hide_TE Macro ' ' ActiveSheet.Range("$A$2:$C$18").AutoFilter Field:=3, Criteria1:="=" Columns("C:C").Select Range("C2").Activate Selection.EntireColumn.Hidden = True End Sub Sub Show_TE() ' ' Show_TE Macro ' ' Columns("B:D").Select Range("D2").Activate Selection.EntireColumn.Hidden = False ActiveSheet.Range("$A$2:$C$18").AutoFilter Field:=3 Range("A1:F1").Select End Sub
Thanks a lotTea Making WBS.xlsx
Bookmarks