Hiding rows with cells locked using format protection lock functio

  • Thread starter Thread starter John G.
  • Start date Start date
J

John G.

I have a macro that hides rows based on 0 value in certain rows in a single
column using autofilter. I have as a convenience, protected two columns of
data to the left of the sorted column so that user can just use the enter key
to pass over the two columns to the next allowable editable cell. But because
I have locked the cells in those columns, my macro will not collapse the
sheet based on 0 values next to the cells that are locked. My feeling is that
I won't be able to get around this. Or can I?...
 
You could add an unprotect line to your code, do the collapse then re-protect
the sheet.

Sub foo()

ActiveSheet.Unprotect Password:="justme"
'your code rund here
ActiveSheet.Protect Password:="justme"

End Sub


Gord Dibben MS Excel MVP
 
My brain gets muddled and can't see the forrest for the trees. There is
always a work around. Thanks!
 

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

Back
Top