View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Hide a column "if"?

Hi,

Alt +f11 to open VB editor, right click 'This Workbook' and insert module
and paste this in.

Sub sonic()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Select
If Range("E2").Value < "Level 1" Then
Columns("F:F").EntireColumn.Hidden = True
End If
Next
End Sub

Mike

"tgcali" wrote:

Hello,

I have a workbook with 250 sheets. I need to be able to hide column F unless
cell E2 has the value "Level 1". If there is another value in E2 or it is
blank, I need column F to be hidden. I need this on all 250 sheets. Is this
possible?

Thanks in advance, you are all always to helpful!

tgcali