Hiding Columns

  • Thread starter Thread starter Ruan
  • Start date Start date
R

Ruan

Hello,

The below code works great, but I would like to tweak it a little, to only
hide the Columns that have blank cells in the range ("I9:P9").


Sub HideColumns()
Worksheets("Activity Totals").Unprotect Password:="1234"
With Range("I9:P9")
.EntireColumn.Hidden = False
.SpecialCells(xlCellTypeBlanks).EntireColumn.Hidden = True
End With
Range("B10").Select
Worksheets("Activity Totals").Protect Password:="1234", Scenarios:=True

End Sub


Thanks
Ruan
 
Ruan,

Isn't that exactly what it does?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Bob,

I am sorry. I am an idiot. I must have added another row, so now the range
should be ("I10:P10"). It is working great.
 
Back
Top