2

As per the title, I want to "move" the contents of a cell one column to the right once a week, specifically Sunday at 11pm

Must I use a script for that?

1
  • What have you already tried? We're happy to try to help you (and future readers) but we're not a code-generating service. I suggest you read up at our help center.
    – ale
    Sep 9, 2013 at 19:29

1 Answer 1

1

This piece of script will move the first entry of a row range to the next column:

Code

function myShift() {
  var sh = SpreadsheetApp.getActiveSheet();
  var data = sh.getRange("1:1").getValues();
  var counter=0;
  for(var i=0, iLen=data[0].length; i<iLen; i++) {
    if(data[0][i] == "") {
      counter++;
    } else {
      data[0][counter+1] = data[0][i];
      data[0][counter] = "";
      break;
    }
  }
  sh.getRange("1:1").setValues(data);
}

Trigger

enter image description here

Example

I've created an example file for you: Copy and Paste Cell Contents Once a Week

Explained

Add the script under Script Editor from the Tools menu. Press the "bug" button to debug the code and to authenticate the script. Goto Resources (in the script editor) and set the trigger as shown.

2
  • Hi and thank you - I updated the example file to reflect more accurately my usage. Specifically I want to move all column B entries to column C, from rows 2 down. :) So once a week Bs value goes to C and B is left empty and is ready to receive the data for the current week... could you perhaps advise on the necessary script changes to be made?
    – Drewdavid
    Sep 16, 2013 at 22:32
  • @Drewdavid I don't want to be a spoiler, but that's a different question that needs a different approach. Please ask this question in detail again and I (or somebody else) will respond to that. Sep 17, 2013 at 8:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.