View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Chip Pearson
 
Posts: n/a
Default Unprotect worksheet via VBA

Try

ActiveSheet.Unprotect password:="whatever"
' do your sort
ActiveSheet.Protect password:="whatever"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Mike Echo" wrote in message
u...
I tried to sort a sheet via VBA and kept getting an error until
I
figured it was the protection stopping things. How can I turn
off
protection, sort, then turn on protection again?

I looked in help and found ActiveWorkbook.Unprotect
("password") but it
doesn't work. Any pointers in the right direction much
appreciated.

TIA,
R.