I have two sheets in My Google Spreadsheet.
- Master Tracking
- Daily Tracking
Master Tracking pulls in information from other tracking sheets and updates the number of miles driven by each driver in cell M7.
I want to set up Daily Tracking with Date (Column A) and Number of Miles Traveled (Column B).
I want to write a Google Apps script which will copy the data from Master Tracking!M7 to Daily Tracking (column B) but into a NEW ROW every time the script is run. I'm planning on using a trigger for it to run at the end of every work day.
I have this till now but it doesn't work.
function copyFunction() {
var inputRange = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Master Tracking").getRange("M7:M7");
var inputValues = inputRange.getValues();
var outputRange = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Daily Tracking").getRange("B:B").getLastRow();
outputRange.setValue(inputValues);
}
I can't figure it out. I can get it to paste in one specific cell but I can't figure out how to paste it into a new row. Maybe getLastRow would work. I don't know.
Also, how to have a timestamp put in Column A of Daily Tracking?
Please help!