Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
dave glynn
 
Posts: n/a
Default hiding columns automatically

I have a number of columns on a spreadsheet that need not be viewed or
printed if a given field within that range is zero. I am lloking for syntax
that will automatically hide (say) columns a to f where the value in (say)
c20 is less than 1?

I have macro that closes the columns if I select them manually but given
volumes need to do this automatically.

Any ideas


Thanks
  #2   Report Post  
tjtjjtjt
 
Posts: n/a
Default

Something like this perhaps? You will have to assign it to a button or run it
from the macro dialog.

Sub HideAtoF()
If Range("C20").Value < 1 _
Then Range("A:F").Columns.EntireColumn.Hidden = True
End Sub

tj

"dave glynn" wrote:

I have a number of columns on a spreadsheet that need not be viewed or
printed if a given field within that range is zero. I am lloking for syntax
that will automatically hide (say) columns a to f where the value in (say)
c20 is less than 1?

I have macro that closes the columns if I select them manually but given
volumes need to do this automatically.

Any ideas


Thanks

  #3   Report Post  
 
Posts: n/a
Default

hi,
Private Sub Worksheet_SelectionChange(ByVal Target As
Range)

If Range("C20").Value = 0 Then
Columns("A:F").EntireColumn.Hidden = True
Else
Columns("A:F").EntireColumn.Hidden = False
End If

End Sub

-----Original Message-----
I have a number of columns on a spreadsheet that need not

be viewed or
printed if a given field within that range is zero. I am

lloking for syntax
that will automatically hide (say) columns a to f where

the value in (say)
c20 is less than 1?

I have macro that closes the columns if I select them

manually but given
volumes need to do this automatically.

Any ideas


Thanks
.

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 automatically dave glynn Excel Discussion (Misc queries) 0 February 1st 05 06:15 PM
making columns automatically turn numbers into negatives Kathy Excel Worksheet Functions 6 February 1st 05 05:23 AM
Hiding columns based on user/password jmatchus Excel Worksheet Functions 0 January 17th 05 06:49 PM
Columns in Excel will not allow user to click in them Kim Excel Discussion (Misc queries) 1 December 28th 04 06:37 PM
Counting the Contents of Two Columns Molochi Excel Discussion (Misc queries) 6 December 22nd 04 08:13 PM


All times are GMT +1. The time now is 10:48 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"