Welcome to Code Forum!

Join a community that supports you and your coding journey from day one. We strive to be a friendly, supportive community that empowers everyone to be better developers. By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.

    GIF shows where to locate </> in the thread and or post editor toolbar.
    To learn more about how to use our BBCode feature, review our "How to post your code into threads" here.

    Thank you, Code Forum.

JavaScript Copy - Paste value from one tab to another

Felixalgo

New Coder
Hi,

My issuse is the following : I would like you to write a google script. This script would allow to automate the following operation. In the tab Interview Tracker, when the value 7 - Offered is selected in the column Status (Column G), the value being on the same line of the column Role (column B) should be copied and pasted in the last row of the tab Offer Tracker in the column Role (column C). I would like rela time results. I can also tell you that The Interview Tracker Tab is composed of columns from A to J. The Offer tracker tab is composed of columns from A to G.



I generated the following code but this does not work. Coud you please help me? Many thanks in advance.

JavaScript:
function onEdit(e) {

  var interviewTrackerSheet = e.source.getSheetByName("Interview Tracker");

  var offerTrackerSheet = e.source.getSheetByName("Offer Tracker");

  var editedRange = e.range;

  var editedSheet = editedRange.getSheet();

  if (editedSheet.getName() === "Interview Tracker" && editedRange.getColumn() === 7) {

    var editedRow = editedRange.getRow();

    var status = editedRange.getValue();

    if (status === "7 - Offered") {

      var role = interviewTrackerSheet.getRange(editedRow, 2).getValue(); // Column B

      var lastRow = offerTrackerSheet.getLastRow();

      offerTrackerSheet.getRange(lastRow + 1, 3).setValue(role); // Column C

    }

  }

}
 
Last edited by a moderator:
Hi there 👋

Please remember to use BBCode or Markdown to format your code. Without it, it makes it hard to read your code.

Are you receiving any errors, could you describe more on what's not working?
 

Buy us a coffee!

Buy me a coffee.
Back
Top Bottom