Google Sheets Help
Discussion
Need some help with google sheets.
We have a spredsheet we use for tracking jobs in the workshop. We use a dropdown to prioritise these jobs.
Once the job is completed, we mark it completed and drag it down the page. Is there a way to automate this, so once "completed" is selected, that line automatically drops to the bottom of the page.
We have a spredsheet we use for tracking jobs in the workshop. We use a dropdown to prioritise these jobs.
Once the job is completed, we mark it completed and drag it down the page. Is there a way to automate this, so once "completed" is selected, that line automatically drops to the bottom of the page.
Edited by 808 Estate on Friday 12th April 21:46
Yup...
This script runs whenever the "completed" status is selected in the dropdown menu.
function onEdit(e) {
var sheet = e.source.getActiveSheet();
var editedCell = sheet.getActiveCell();
var columnToWatch = 3; // Change this to the column number where your dropdown is located
if (editedCell.getColumn() == columnToWatch && editedCell.getValue() == "completed") {
var range = sheet.getRange(editedCell.getRow(), 1, 1, sheet.getLastColumn());
var rowValues = range.getValues()[0];
range.clear();
sheet.appendRow(rowValues);
}
}
1. Open your Google Sheets document.
2. Go to Extensions > Apps Script to open the Google Apps Script editor.
3. Delete any code in the script editor and replace it with the following code above.
4. Save the script with a name, then close the Apps Script tab.
Whenever you select "completed" in the dropdown menu in the specified column, the corresponding row will be moved to the bottom of the sheet.
Just check to adjust the "columnToWatch" variable to match the column number where your drop down menu for job status is located. Also, ensure that the word "completed" matches exactly what is in your dropdown menu.
This script runs whenever the "completed" status is selected in the dropdown menu.
function onEdit(e) {
var sheet = e.source.getActiveSheet();
var editedCell = sheet.getActiveCell();
var columnToWatch = 3; // Change this to the column number where your dropdown is located
if (editedCell.getColumn() == columnToWatch && editedCell.getValue() == "completed") {
var range = sheet.getRange(editedCell.getRow(), 1, 1, sheet.getLastColumn());
var rowValues = range.getValues()[0];
range.clear();
sheet.appendRow(rowValues);
}
}
1. Open your Google Sheets document.
2. Go to Extensions > Apps Script to open the Google Apps Script editor.
3. Delete any code in the script editor and replace it with the following code above.
4. Save the script with a name, then close the Apps Script tab.
Whenever you select "completed" in the dropdown menu in the specified column, the corresponding row will be moved to the bottom of the sheet.
Just check to adjust the "columnToWatch" variable to match the column number where your drop down menu for job status is located. Also, ensure that the word "completed" matches exactly what is in your dropdown menu.
Gassing Station | Computers, Gadgets & Stuff | Top of Page | What's New | My Stuff