Hiding Columns

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
 
B

Bob Phillips

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)
 
R

Ruan

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top