I've created a script that does what you ask for. But since you can't invoke "Undo" with script it starts with copying your data to a separate sheet (called "scriptSheet"), which you have to create. You can hide it after that. This copying happens every time you open your spreadsheet.
When you edit a cell in a specified range the script checks if a date and time specified by you has passed, if it has it informs the user and copies the value from the scriptSheet. If the date hasn't passed the value is instead copied into the scriptSheet.
So here's the script:
function onOpen() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("Locked Sheet"); //Edit to be the name of your sheet
var scriptSheet = ss.getSheetByName("scriptSheet");
var lastRow = sheet.getLastRow();
var lastCol = sheet.getLastColumn();
scriptSheet.clear();
sheet.getRange(1, 1, lastRow, lastCol).copyTo(scriptSheet.getRange(1, 1));
}
function onEdit(){
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet();
var range = sheet.getActiveRange();
var currRow = range.getRow();
var currCol = range.getColumn();
if(sheet.getName() == "Locked Sheet" && currCol == 1){ //Edit to be the name of your sheet and column with dropdowns
var lockDateRange = sheet.getRange(2, 6); //Edit to be the address of the cell with your date or set to string, '3/16/2013 17:00:00' for example
var scriptSheet = ss.getSheetByName("scriptSheet");
var now = new Date();
var lockDate = new Date(lockDateRange.getValue());
if (now > lockDate){
scriptSheet.getRange(currRow, currCol).copyTo(sheet.getRange(currRow, currCol));
Browser.msgBox("You do not have permission to edit this cell");
}else{
sheet.getRange(currRow, currCol).copyTo(scriptSheet.getRange(currRow, currCol));
}
}
}
Right now the date is retrieved from a cell (F2
) as stated in the comment on row 19 you can write the date in the script instead. The cell reference just makes it easier to change the date.
Best Answer
It appears that built-in search does not cover notes (or comments) added to spreadsheet. So I wrote a script that searches all notes within the active sheet. (It does not search comments, since scripts are currently unable to access comments at all.)
After entering the script (Tools > Script Editor), you will see a new menu item next time you open the spreadsheet: it will be Custom > Search notes.
There is no user interface; the search term is the content of the currently active cell, and the search results are placed in that cell, replacing the term. The search results are stated as "D5: content of the note" where D5 is the cell to which the note is attached.
One can search for empty text: the result will be the summary of all notes in the sheet, which may be useful.
The search is case-insensitive.