Lock cells after text entered in merge cells and saved (VBA Code)

Trebby

Board Regular
Joined
Aug 7, 2014
Messages
64
Hi Guys,

Would someone mind taking the time to help?

I've attached a simple spreadsheet which will hopefully show the basics of what I am trying to achieve.

On the sheet it has 12 (yellow) free text boxes, which is listed against month/year. Now what I need it to do is that once text is entered and then the saved button is pressed, I want it to lock these cells so no data can be changed unless the admin unprotect these with a password. This will be on a month to month basis and the following months will need to remain open. I don't know whether the best method will be to auto lock the cells after 45-50 days after the 1st of the previous month (the reason for this method is that for example April's data will be entered in May as this will be a monthly review on the previous month).

Open to suggestions.

Is this possible?

File in link below
https://www.mediafire.com/?r60h5y0g04t2747

Thanks in advance for your help.
 
Last edited:

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
I have found this bit of code but can't get it to work, any suggestions?

Private Sub workbook_open()
ActiveSheet.unprotect Password:="12345"
If Date > #4/18/2015# Then
Range("C14:M14").Locked = True

ActiveSheet.Protect Password:="12345"
ThisWorkbook.Save
End If

End Sub
 
Upvote 0

Forum statistics

Threads
1,214,944
Messages
6,122,392
Members
449,081
Latest member
JAMES KECULAH

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