View Single Post
  #7   Report Post  
William
 
Posts: n/a
Default

Pennington

Place the code in the "ThisWorkbook" module, NOT a general module.

-----
XL2003
Regards

William



"Pennington" wrote in message
...
Thank William but I can't get it to work. I have placed this code in
Module 1
of the workbook
Private Sub Workbook_Open()
With Sheets("ProcessA")
Range("E3:M3").EntireColumn.Hidden = False
If .Range("C4").Value = False Then _
Range("E3:M3").EntireColumn.Hidden = True
End With
End Sub
Saved the file closed and opening it but all the columns are still showing

"William" wrote:

Hi..

Private Sub Workbook_Open()
With Sheets("Sheet1")
..Range("E3:M3").EntireColumn.Hidden = False
If .Range("C4").Value = False Then _
..Range("E3:M3").EntireColumn.Hidden = True
End With
End Sub

-----
XL2003
Regards

William




"Pennington" wrote in message
...
I am trying to hide a range of cells when the value in another cell is
FALSE
and show the range of cells when the value is TRUE. My code is as
follows
but
it doesn't work
Private Sub Workbook_Open()
If Range("C4").Value = False Then
Range("E4:M40").Hide = True
End If
If Range("C4").Value = True Then
Range("E4:M40").Unhide = False
End Sub

How do I make this work?