اذهب الي المحتوي
أوفيسنا
بحث مخصص من جوجل فى أوفيسنا
Custom Search

تقييد onedit على شيت واحد فقط في google sheets


الردود الموصى بها

السلام عليكم ورحمة الله

الرجاء أريد أن يعمل هذا الكود مع شيت معين فقط أو شيتات مختارة وليس كل الشيتات الموجودة بالملف

لان onedit تعمل على كل الشيتات في جوجل شيت ولا أريد ذلك وشكرا

 

/**
* Creates a Date Stamp if a column is edited.
*/
 
//CORE VARIABLES
// The column you want to check if something is entered.

var COLUMNTOCHECK = 9; //العمود الذي سيتم الكتابة فيه ليظهر التاريخ في العمود الذي بعده

// Where you want the date time stamp offset from the input location. [row, column]
var DATETIMELOCATION = [0,1]; // رقم الصف/العمود الذي سيظهر فيه التاريخ بعد العمود الذي سيتم الكتابة فيه
// Sheet you are working on
var SHEETNAME = 'LEADS VIP_DATA'
var SHEETNAME1 = 'FDATA'
 
function onEdit(e) {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = ss.getActiveSheet();
  //checks that we're on the correct sheet.
  if( sheet.getSheetName() == SHEETNAME || SHEETNAME1 || SHEETNAME2 ) {
    var selectedCell = ss.getActiveCell();

 
    //checks the column to ensure it is on the one we want to cause the date to appear.
    if( selectedCell.getColumn() == COLUMNTOCHECK) {
      var dateTimeCell = selectedCell.offset(DATETIMELOCATION[0],DATETIMELOCATION[1]);
      dateTimeCell.setValue(new Date()).setNumberFormat(timezone,"dd/MM/yyyy HH:mm");

      }
  }
}

 

رابط هذا التعليق
شارك

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information