ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Toggle button for hide/unhide columns (https://www.excelbanter.com/new-users-excel/451261-toggle-button-hide-unhide-columns.html)

user_excel1

Toggle button for hide/unhide columns
 
1 Attachment(s)
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...

Claus Busch

Toggle button for hide/unhide columns
 
Hi,

Am Fri, 15 Jan 2016 14:28:21 +0000 schrieb 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...

+-------------------------------------------------------------------+
|Filename: toggle_button.jpg |
|Download: http://www.excelbanter.com/attachment.php?attachmentid=1024|
+-------------------------------------------------------------------+


why don't you filter by these values?


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional

wickedchew

Quote:

Originally Posted by user_excel1 (Post 1622826)
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


All times are GMT +1. The time now is 05:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com