Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9782

Sync two sheets, but 2nd sheet only pulls a subset of data based on the next 14 days starting from today [closed]

$
0
0

I have been reading and trying various solutions and have not come even close to getting what I need.I have a 'Working' sheet where I have pulled in responses from a google form. The form response sheet is left alone. Everything is copied to Working and that sheet is where I manipulate the info to get everything I need.

The problem though is that the Working sheet is a lot! I need someone who doesn't know anything to get work done using this information.

So I created what I call a Dashboard. I know, most people want a dashboard to be something else. In my case, it is a smaller set of data, only the next 14 days, starting from today. So it changes every day what info is pulled from the Working sheet. I have been using a query formula to pull what I need. If you look at my sheets, some of the 'buttons' on the left side are not active because I haven't figured that part out yet.

I need to be able to have the next 14 days sync into the Dashboard AND allow me to make changes. Using a query I can't change drivers or buses or anything else, I have to go to the Working sheet to make changes. So using a formula will not work. I need all changes to also sync back to the Working sheet. I'm talking about 2-way sync between sheets. Also, the cells to sync from Working to Dashboard are not the same cells/columns.

Please, help would be very appreciated!

Here is my test sheet.

Here is the code I have tried most recently because I really thought this was the one!

function onEdit(e) {  var sheetName = ['Working', 'Dashboard',];  // name of sheets  var firstCell = ['W', 'B'];    // First pair of cells to sync  var secondCell = ['X', 'C'];    // Second pair of cells to sync  var thirdCell = ['AC', 'D'];    // First pair of cells to sync  var fourthCell = ['S', 'E'];    // Second pair of cells to sync  var fifthCell = ['T', 'F'];    // First pair of cells to sync  var sixthCell = ['Q', 'G'];    // Second pair of cells to sync  var seventhCell = ['AF', 'H'];    // First pair of cells to sync  var eightCell = ['R', 'I'];    // Second pair of cells to sync  var r = e.range;  var ss = e.source;  var value = (e.value === undefined ? "" : e.value);  var i = sheetName.indexOf(r.getSheet().getSheetName());   if (i > -1 && r.getA1Notation() == firstCell[i]) {    for (var k = 0; k < sheetName.length; k++) {      if (k != i) {        ss.getSheetByName(sheetName[k]).getRange(firstCell[k]).setValue(value);      }    }  }  if (i > -1 && r.getA1Notation() == secondCell[i]) {    for (var k = 0; k < sheetName.length; k++) {      if (k != i) {        ss.getSheetByName(sheetName[k]).getRange(secondCell[k]).setValue(value);      }    }  }}

Viewing all articles
Browse latest Browse all 9782

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>