Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am new to VB and very frustrated. I am trying to hide columns that
represents date reporting periods based on whether the column and particular date is outside of a range: Private Sub CommandButton1_Click() Dim cell As Range Application.ScreenUpdating = False With ActiveSheet For Each cell In .Range("b8:bt8") If cell.Value .Range("pop_key") Then ..cell.EntireColumn.Hidden = True Next End With Application.ScreenUpdating = True End Sub I keep getting a runtime 1004 error on the "if cell.value" line. v/r PAZZ |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is the named range "pop_key" located on the activesheet? If not, then
remove the period from in front of .Range("pop_key") -- Regards, Tom Ogilvy wrote in message oups.com... I am new to VB and very frustrated. I am trying to hide columns that represents date reporting periods based on whether the column and particular date is outside of a range: Private Sub CommandButton1_Click() Dim cell As Range Application.ScreenUpdating = False With ActiveSheet For Each cell In .Range("b8:bt8") If cell.Value .Range("pop_key") Then .cell.EntireColumn.Hidden = True Next End With Application.ScreenUpdating = True End Sub I keep getting a runtime 1004 error on the "if cell.value" line. v/r PAZZ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
hiding cells | Excel Discussion (Misc queries) | |||
hiding cells | Excel Discussion (Misc queries) | |||
Hiding Cells | Excel Discussion (Misc queries) | |||
Hiding Cells | Excel Discussion (Misc queries) | |||
hiding cells from others | Excel Worksheet Functions |