Quote:
Originally Posted by user_excel1
I have looked in all kind of forums but unfortunately I had no chance finding the solution for my problem..
Being a absolute beginner in Excel I need someone to help me.
I use Excel 2010 and I need to do next task..
I have a table with 8 rows and 10 columns. I have to create a toggle button to show only certain columns.
For example.
If in B2, B5, B9 etc.. says "FINISHED", and in B1, B3,B4,B6 says "NOT FINISHED" I need the toggle buttons that when clicked only shows entire columns with these perimeters...
Anyway, I have attached screenshot of what I was thinking...
|
Yup. Filtering would be so much easier. But if you wanted it in a code:
Sub HideFinishedColumns()
Application.ScreenUpdating = False
a = Range("H" & Rows.Count).End(xlUp).Row
For b = a To 1 Step -1
If Cells(b, 8) = "F" Then
Rows(b).Select
Selection.EntireRow.Hidden = True
End If
Next b
Application.ScreenUpdating = True
End Sub
Sub ShowAllColumns()
Application.ScreenUpdating = False
Cells.Select
Selection.EntireRow.Hidden = False
Range("A1").Select
Application.ScreenUpdating = True
End Sub