Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Hiding Cells

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Hiding Cells

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
hiding cells swiv Excel Discussion (Misc queries) 3 December 13th 07 04:38 PM
hiding cells Tropical Excel Discussion (Misc queries) 1 March 23rd 07 07:32 PM
Hiding Cells Jared Jenner Excel Discussion (Misc queries) 2 August 3rd 06 04:11 PM
Hiding Cells Chris Excel Discussion (Misc queries) 5 June 20th 06 07:05 PM
hiding cells from others BorisS Excel Worksheet Functions 1 December 14th 05 02:36 PM


All times are GMT +1. The time now is 10:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"