In my task list each row includes a timeline dropdown menu (F) and a do date cell (K). I want the Timeline dropdown to automatically change based on the date in the do date column.
For example I would like the timeline dropdown to change to Today if the date in the do date column is today's date. I would also like the timeline dropdown to change to Tomorrow if the date in the do date column is tomorrow's date.
I've tried to create the code based on the responses in a few other different forums. However, I have not been able to successfully create the function.
function onEdit(event) //
{
var ColK = 11; // Column Number of "K"
var now = new Date();
var changedRange = event.source.getActiveRange();
if (changedRange.getColumn() == ColK)
{
// An edit has occurred in Column K
var state = changedRange.getValue();
var Group = event.source.getActiveSheet().getRange(changedRange.getRow(),ColK-5);
switch (state)
{
case "now”:
// Select TODAY from dropdown list
Group.setValue("TODAY");
break
}
}
}