G Guest Feb 12, 2004 #1 Is it possible to unprotect a sheet using a macro then manipulate data in the sheet and then repassword protect in the same macro
Is it possible to unprotect a sheet using a macro then manipulate data in the sheet and then repassword protect in the same macro
C Chip Pearson Feb 12, 2004 #2 Paul, Try something like Worksheets("Sheet1").Unprotect password:="whatever" ' your code here Worksheets("Sheet1").Protect password:="whatever" -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com paul d said: Is it possible to unprotect a sheet using a macro then Click to expand... manipulate data in the sheet and then repassword protect in the same macro
Paul, Try something like Worksheets("Sheet1").Unprotect password:="whatever" ' your code here Worksheets("Sheet1").Protect password:="whatever" -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com paul d said: Is it possible to unprotect a sheet using a macro then Click to expand... manipulate data in the sheet and then repassword protect in the same macro
G Gord Dibben Feb 12, 2004 #3 Paul Yes it is. Assuming the sheet has been previously protected with a password Sub Test() ActiveSheet.Unprotect Password:="password" 'do your manipulation steps here ActiveSheet.Protect Password:="password", DrawingObjects:=True, _ Contents:=True, Scenarios:=True End Sub Gord Dibben Excel MVP
Paul Yes it is. Assuming the sheet has been previously protected with a password Sub Test() ActiveSheet.Unprotect Password:="password" 'do your manipulation steps here ActiveSheet.Protect Password:="password", DrawingObjects:=True, _ Contents:=True, Scenarios:=True End Sub Gord Dibben Excel MVP
G Guest Feb 12, 2004 #4 You're a lifesaver works perfectl ----- Chip Pearson wrote: ---- Paul Try something lik Worksheets("Sheet1").Unprotect password:="whatever ' your code her Worksheets("Sheet1").Protect password:="whatever -- Cordially Chip Pearso Microsoft MVP - Exce Pearson Software Consulting, LL www.cpearson.co paul d said: Is it possible to unprotect a sheet using a macro the Click to expand... manipulate data in the sheet and then repassword protect in th same macr
You're a lifesaver works perfectl ----- Chip Pearson wrote: ---- Paul Try something lik Worksheets("Sheet1").Unprotect password:="whatever ' your code her Worksheets("Sheet1").Protect password:="whatever -- Cordially Chip Pearso Microsoft MVP - Exce Pearson Software Consulting, LL www.cpearson.co paul d said: Is it possible to unprotect a sheet using a macro the Click to expand... manipulate data in the sheet and then repassword protect in th same macr