Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mike Echo
 
Posts: n/a
Default Unprotect worksheet via VBA

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.
  #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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Needed: worksheet export help mainemike Excel Discussion (Misc queries) 1 February 24th 06 02:59 AM
Update Worksheet to Worksheet Wendy Gunter Excel Worksheet Functions 0 October 5th 05 02:36 PM
Search/Match between 2 x separate Worksheets and populate result in third worksheet Alan Bartley Excel Discussion (Misc queries) 1 April 11th 05 05:21 AM
Copy from worksheet to another x times Union70 Excel Discussion (Misc queries) 0 March 7th 05 09:03 PM
How can I unprotect a worksheet that is password protected Password Excel Discussion (Misc queries) 3 December 30th 04 06:13 PM


All times are GMT +1. The time now is 03:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"