ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hiding Columns (https://www.excelbanter.com/excel-programming/282510-hiding-columns.html)

Ruan[_3_]

Hiding Columns
 
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.Hidde n = True
End With
Range("B10").Select
Worksheets("Activity Totals").Protect Password:="1234", Scenarios:=True

End Sub


Thanks
Ruan




All times are GMT +1. The time now is 09:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com