Thread: hide column
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Andrew Taylor Andrew Taylor is offline
external usenet poster
 
Posts: 225
Default hide column

Try this:

Dim i As Integer, ws as worksheet
For Each ws in ActiveWorkbook.Worksheets
For i = 1 To 255
If ws.Cells(3, i).Value = 1 Then
ws.Columns(i).Hidden = True
End If
Next
Next


Steph wrote:

Hi. Is there a way to have vba scan every visible worksheet, and look in
row 3. If there is a 1 in a cell in row 3, hide that column? Thanks!