Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Not Hiding Columns

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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
.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hiding Columns lehigh46 Excel Worksheet Functions 2 November 28th 05 11:41 PM
Hiding Columns belony Excel Discussion (Misc queries) 4 June 15th 05 12:27 AM
Hiding columns Adam Excel Discussion (Misc queries) 2 March 31st 05 05:07 PM
Hiding Columns Ruan[_3_] Excel Programming 0 November 13th 03 11:42 PM
Hiding columns in VB Rick B[_4_] Excel Programming 6 November 12th 03 07:22 PM


All times are GMT +1. The time now is 07:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"