View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
iCalculate iCalculate is offline
external usenet poster
 
Posts: 4
Default Select Variable Number of Columns

On Jul 8, 2:12 pm, Mike H. wrote:
Just wondering, would the hiding routine go faster if I were to select a
range of columns to hide, rather than just one column at a time? That is
what I was originally trying to do and couldn't get it right. If you don't
think so, use what you gave me.

Another issue:
Do you know if I have cells within the column protected, I can't seem to
hide the column. Do you know how to allow protected cells to be hidden and
still be protected?


You are right, bad habit of using iteration ;). I think this will wokr
much faster

Sub Hide_cols()
Dim col As String, i As Integer
col = CStr(InputBox("Give the last column letter"))
Range("c:" & col).Columns.Hidden = True
'Columns.Hidden = False
End Sub

as for your other question try to choose toolsprotectionprotect
worksheet and set alowance to format columns, that should do.