Hello All,
I am looking for a formula or macro that will hide multiple columns in an excel worksheet based on the value in the Header of the worksheet?
Hello All,
I am looking for a formula or macro that will hide multiple columns in an excel worksheet based on the value in the Header of the worksheet?
OK, how exactly. Do you want it to hide the columns that match the text in the header? (I assume you are talking about the header from when you print the page and not the value in the first row of each column)
.?*??)
`?.???.?*??)?.?*?)
(?.?? (?.?Pichingualas <---
??????????????????????????
Wrap your code with CODE TAGS.
Thank those who helped you, Don't forget to add to their REPUTATION!!! (click on the star below their post).
Please mark your threads as [SOLVED] when they are (Thread Tools->Mark thread as Solved).
No I am referring to the values in Row 1. Is this possible to do in Excel 2003?
This code will let you toggle column hide/show according to the label in row 1.
Regards, AB![]()
Function ToggleHideCol(Lbl As String) As Range Set ToggleHideCol = Rows(1).Find(what:=Lbl, LookIn:=xlFormulas, lookat:=xlWhole) If Not ToggleHideCol Is Nothing Then ToggleHideCol.EntireColumn.Hidden = Not ToggleHideCol.EntireColumn.Hidden End Function Sub ToggleHide() Dim c As Range Dim s As String s = InputBox("Enter a label to find", "Toggle Hide by Label") If Not s = "" Then Set c = ToggleHideCol(Lbl:=s) If c Is Nothing Then Call MsgBox("Label """ & s & """ not found.") End If End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks