View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Peter Atherton[_16_] Peter Atherton[_16_] is offline
external usenet poster
 
Posts: 11
Default Not Hiding Columns

Try unhiding them first before you set the conditions.

range("F1:AM1).entireColumns.Hidden = FAlse
For i = 3 to 20
if cells(i,1) = 0 Then
cells(1,i).entirecolumn.hidden= True
end if
Next i

Each column will have to be hidden separately if say
column A = 0

Regards
Peter
-----Original Message-----
When my code runs, if columns F - P are not already
hidden, the following code is not hiding them


ActiveSheet.Columns("F:AM").Select
Selection.EntireColumn.Hidden = True

I ultimately want all columns from F to AM to be hidden

in
certain circumstances, but if a portion of the columns
have been previously unhidden it will not hide them again.

Thoughts?

Thanks

SS
.