gSheet - Date script not being counted on summary tab

dmj120

Active Member
Joined
Jan 5, 2010
Messages
310
Office Version
  1. 365
  2. 2019
  3. 2010
I found a youtube video to automatically add the date when a checkbox was updated. It seemed like it worked, but now as I look, the "daily summary" page that counts by date and department, is not counting correctly. I tried formatting, but doesn't do anything.

In this script, column 15 is where I have the checkbox, column 17 is where the date is entered (which does work - although if you uncheck the box, the date remains), but, again, the check/date entries are not counted on the summary page.

Any ideas?

Code:
function onEdit(e) {
 
  addTimestampRL(e)


}

function addTimestampRL(e) {
  //variables
  var startRow = 2;
  var targetColumn = 15;
  var ws = "Renovo (Internal)";

  //get modified row and column
  var row = e.range.getRow();
  var col = e.range.getColumn();

  if(col === targetColumn && row >= startRow && e.source.getActiveSheet().getName() === ws){

    var currentDate = new Date();

    if(e.source.getActiveSheet().getRange(row,17).getValue() == ""){
      e.source.getActiveSheet().getRange(row,17).setValue(currentDate);
    }
  }

}
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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