Error 400 on making row visible on a protected sheet

  • Thread starter gimme_this_gimme_that
  • Start date
G

gimme_this_gimme_that

I have a button which kicks off a VBA method which either hides or
unhides rows on a Worksheet.

I'd like to protect the worksheets but if I do an Error 400 occurs when
the VBA attempts to change a row's status from visible to invisible.

I've tried various protection settings but I still get the same error.

Is there one I should have tried?

Any suggestions? Should I have VBA unprotect/protect the sheet?
 
N

Nick Hodge

Use the VBA to unprotect the sheet just before unhiding and then protect
again just after

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
(e-mail address removed)
 
D

dmexcel

thats what I would do


Sub Macro1()
'


ActiveSheet.Unprotect
'your code
ActiveSheet.Protect

End Sub
 
T

Tom Ogilvy

Unprotect the sheet
change the rows
protect the sheet

Look at the Protect and Unprotect methods of the Worksheet object.
 

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