VBA allow edit only when sheet is copied

hajiali

Well-known Member
Joined
Sep 8, 2018
Messages
626
Office Version
  1. 2016
Platform
  1. Windows
Hello All I have a sheet (Master) where I have protected with password were I do not want anyone to change or modify. However, when sheet is copied and named as "today's Date" I want it to be unprotected so that it is changeable and can be modified.

Perhaps when someone attempts to change "Master" sheet it prompts user to copy sheet first.

Any suggestions
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
for anyone interested I was able to get it copied and unprotected and change to today's date using below code

Code:
Sub Copy_Unprotect_Sheet()    
    Sheets("MASTER").Select
    Sheets("MASTER").Copy After:=Sheets(10)
    Sheets("MASTER (2)").Select
    Sheets("MASTER (2)").Unprotect "PASSWORD USED"
    ActiveSheet.Name = Replace(Format(Now, "mm.dd.yyyy"), ":", "|")
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,705
Messages
6,173,985
Members
452,540
Latest member
haasro02

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top