
Originally Posted by
bnnaga
1. I have an Excel sheet which is protected. Is there any way to unprotect the sheet using VBA Codes?
2. I have an Excel sheet with macro, in which the project is locked and I have forget the password. Is there any way to unlock the project?
3. I have created a macro and whenever I open that macro, it is asking for 'Enable/Disable' option. Actually I need it to be enabled automatically without displaying an alert?
4. Whenever I try to insert newsheet it will be inserted towards left of the current sheet. Is there a way to get it inserted towards right of current sheet?
1. You can use your macro recorder to protect and unprotect a sheet, if you want to use passwords then you will need a little more
Something like:
Sub ProtectSheet()
Dim Password 'This line of code is optional
Password = "1234"
ActiveSheet.Protect Password, True, True, True
End Sub
Sub UnProtectSheet()
Password = "1234"
ActiveSheet.Unprotect Password
End Sub
2. Don't know
3.You can't auto enable
4. I suppose you could have an auto sort macro so the new sheets are always in the correct order
Here is a huge source of information on worksheets
http://www.mvps.org/dmcritchie/excel/sheets.htm
Bookmarks