DoosanRuss
New Member
- Joined
- Aug 3, 2010
- Messages
- 25
Good Afternoon All
I've found this code on the tin-ter-web and it works
however my Range is K8 to CD12, when i change the code to CD12 it hides all the columns regardless of cells containing data greater than Zero.
What i would like the code to do is look at cells K8, K9, K10, K11 & K12 if they all equal "0" i want Excel to hide the column
If any of those cells are greater than "0" then the column stays unhidden.
then move on to the next column J8, J9 ... etc
All help gratefully recieved
BR
Russ
I've found this code on the tin-ter-web and it works
Code:
Private Sub Worksheet_Calculate()
Application.ScreenUpdating = False
Dim c As Range
For Each c In Range("K8:CD8")
c.EntireColumn.Hidden = (c.Value = 0)
Next c
Application.ScreenUpdating = True
End Sub
however my Range is K8 to CD12, when i change the code to CD12 it hides all the columns regardless of cells containing data greater than Zero.
What i would like the code to do is look at cells K8, K9, K10, K11 & K12 if they all equal "0" i want Excel to hide the column
If any of those cells are greater than "0" then the column stays unhidden.
then move on to the next column J8, J9 ... etc
All help gratefully recieved
BR
Russ
Last edited: