ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro on Protected sheet (https://www.excelbanter.com/excel-programming/382078-macro-protected-sheet.html)

Ryton

Macro on Protected sheet
 
G'Day MVPs, OfficeXP Excel question:

My spreadsheet will manually sort fine when it is protected but when
the same sort is attempted via a macro it reports a protection
conflict error. How can I workaround this problem?


Alan[_2_]

Macro on Protected sheet
 
Hi Ryton,

Sheets("Sheet 1").Unprotect
"Your code"
Sheets("Sheet 1").Protect

This will unprotect the sheet, run your macro, then protect the sheet again.
Of course, change the Sheet 1 name to your sheet name.

Alan

"The only dumb question is the question left unasked."


"Ryton" wrote in message
ps.com...
G'Day MVPs, OfficeXP Excel question:

My spreadsheet will manually sort fine when it is protected but when
the same sort is attempted via a macro it reports a protection
conflict error. How can I workaround this problem?




Ryton

Macro on Protected sheet
 
Thanks Alan!


Alan[_2_]

Macro on Protected sheet
 
Glad to help.


"Ryton" wrote in message
oups.com...
Thanks Alan!





All times are GMT +1. The time now is 07:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com