Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Gary,
Place this code in the ThisWorkbook module and change "MySheet" to the sheet you wish to hide columns on. Ben Private Sub Workbook_Open() Sheets("MySheet").Columns("P:AB").EntireColumn.Hid den = _ (Sheets("Start").Range("U4").Value = "OFF") End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Gary,
One other thought: you could enter the code on the "Start" sheet's code module under the Deactivate event. That way the users can change cell U4 of the "Start" sheet and see the change right away, but you won't have the event firing every time a cell is selected on other sheets. Here's the modified code: Private Sub Worksheet_Deactivate() Sheets("MySheet").Columns("P:AB").EntireColumn.Hid den = _ (Sheets("Start").Range("U4").Value = "OFF") End Sub |
#3
![]() |
|||
|
|||
![]()
Thanks Ben.
But this code gave me a syntax error. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
hide row based on cell value | Excel Worksheet Functions | |||
Hide row based on cell value | Excel Worksheet Functions | |||
Hide Next row based on Cell Value | Excel Programming | |||
Is there a way to HIDE a row based on a value of a cell ? | Excel Discussion (Misc queries) | |||
Hide Row Based on cell value | Excel Programming |