Memuat
Memuat
Sync Between Spreadsheets for meal plan and calories
0 views
Copies the Data and Master sheets to a target spreadsheet, such as a copy for a manager or branch. The last sync time is logged on Rekap.

Two files hold the same content with one click.
The real project file is available. It is not just the picture above: you get the working file with every formula in place. It can be downloaded after payment, and we send the download link by WhatsApp or email.
ZIP: .xlsx workbook + Apps Script module (.zip)
| Cell | Formula | What it does |
|---|---|---|
| H5 | =COUNTA(Data!B2:B61) | Number of rows to copy. |
| H6 | =SUM(Data!G2:G61) | Total that must match at the target. |
| H7 | =COUNTA(Master!A2:A11) | Master item count. |
| H8 | =IF(H2="","Isi ID tujuan","Siap") | Check the target ID is filled. |
The script is delivered as a separate Code.gs file inside the ZIP. Paste it into Extensions, Apps Script. A short excerpt:
function sinkronAntarSpreadsheet() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var idTujuan = ss.getSheetByName("Rekap").getRange("H2").getValue();
var tujuan = SpreadsheetApp.openById(idTujuan);
salin_(ss.getSheetByName("Data"), tujuan, "Data");
salin_(ss.getSheetByName("Master"), tujuan, "Master");
ss.getSheetByName("Rekap").getRange("H3").setValue("Sinkron terakhir: " + new Date());
}
function salin_(sumber, tujuan, nama) {
var lembar = tujuan.getSheetByName(nama) || tujuan.insertSheet(nama);
var nilai = sumber.getDataRange().getValues();
lembar.clearContents();
lembar.getRange(1, 1, nilai.length, nilai[0].length).setValues(nilai);
}Columns of the Data sheet:
| Meal | Calories per Serving |
|---|---|
| White Rice 100 g | 130 |
| Boiled Chicken Breast 100 g | 165 |
| Boiled Egg 1 Piece | 78 |
| Fried Tempeh 50 g | 110 |
| Steamed Tofu 100 g | 80 |
| Spinach 100 g | 23 |
| Banana 1 Piece | 105 |
| Oatmeal 40 g | 150 |
| Avocado 100 g | 160 |
| Low Fat Milk 200 ml | 90 |
The sample data is synthetic.
Yes. The picture above is only a preview. After payment we send the download link of the real project file (a ZIP containing the .xlsx workbook and the macro module) by WhatsApp or email.
No. The sample data is synthetic and only shows how the formulas behave. Replace it with your own data and the formulas keep working.
Yes, as a separate order. Message us on WhatsApp with a short description of your columns and what you want to see.
Sample data is synthetic. Google Sheets is a trademark of Google LLC.
Back to Google Sheets portfolio