Question: Google Script Quetion (google spreadsheet) I want to use this timestamp script on two different sheet which is Packing, QC I have tried var sheetName

Google Script Quetion (google spreadsheet)

I want to use this timestamp script on two different sheet which is "Packing", "QC"

I have tried var sheetName = [ 'Packing','QC']; but

still not working any solution will help me a lot

Thanks here is my code

//--------------------------------------------------------------------------

function onEdit(e)

{

var sheetName = 'Packing'; //name of the sheet the script should work on

var colToWatch = 2 // watches for edits made in col B

var colToStamp = 1 //timestamp in col A

if (e.range.columnStart !== colToWatch || e.source.getActiveSheet()

.getName() !== sheetName || e.value == '') return;

var writeVal = e.value !== "" ? new Date() : '';

e.source.getActiveSheet() .getRange(e.range.rowStart, colToStamp) .setValue(writeVal); }

function onOpen()

{ var s = SpreadsheetApp.getActiveSheet() s.setActiveRange(s.getRange(s.getRange('B:B').getValues().filter(String).length +1, 2))

// Change End Number To Indicate Column 1 = A : 2 = B .... }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!