Thread: hide column
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
WhytheQ WhytheQ is offline
external usenet poster
 
Posts: 246
Default hide column

.....and what about when we get spreadsheets with more columns?

On 14 Nov, 16:55, "Andrew Taylor" wrote:
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!- Hide quoted text -- Show quoted text -