I have a script i use to hide columns if the returning calculation= 'NR'
and another similar script with I created if another cell = "0" to hide that column
but the two cant run together- each script un-hides the previous script.
(no matter what order they run in)
Question: How do I join (or run concurrently) these two statements together so - each column remains hidden
(Just a note - the two conditions would never be in the same column)
--------------------------------------------------------------------------------
Sub Hide_NR()
Dim rng As Range, cell As Range
Set rng = Range("I5:EZ5")
Application.Calculation = xlAutomatic
For Each cell In rng
Select Case cell.Value
Case Is = "NR"
cell.EntireColumn.Hidden = True
Case Else
cell.EntireColumn.Hidden = False
End Select
Next cell
Application.Calculation = xmanual
End Sub
-----------------------------------------------------------------
Sub Hide_PlaceHolder()
Dim rng As Range, cell As Range
Set rng = Range("I9:EZ9")
Application.Calculation = xlAutomatic
For Each cell In rng
Select Case cell.Value
Case Is = "0"
cell.EntireColumn.Hidden = True
Case Else
cell.EntireColumn.Hidden = False
End Select
Next cell
Application.Calculation = xmanual
End Sub
--------------------------------------------------------------------------------------
thank you
and another similar script with I created if another cell = "0" to hide that column
but the two cant run together- each script un-hides the previous script.
(no matter what order they run in)
Question: How do I join (or run concurrently) these two statements together so - each column remains hidden
(Just a note - the two conditions would never be in the same column)
--------------------------------------------------------------------------------
Sub Hide_NR()
Dim rng As Range, cell As Range
Set rng = Range("I5:EZ5")
Application.Calculation = xlAutomatic
For Each cell In rng
Select Case cell.Value
Case Is = "NR"
cell.EntireColumn.Hidden = True
Case Else
cell.EntireColumn.Hidden = False
End Select
Next cell
Application.Calculation = xmanual
End Sub
-----------------------------------------------------------------
Sub Hide_PlaceHolder()
Dim rng As Range, cell As Range
Set rng = Range("I9:EZ9")
Application.Calculation = xlAutomatic
For Each cell In rng
Select Case cell.Value
Case Is = "0"
cell.EntireColumn.Hidden = True
Case Else
cell.EntireColumn.Hidden = False
End Select
Next cell
Application.Calculation = xmanual
End Sub
--------------------------------------------------------------------------------------
thank you