0% found this document useful (0 votes)
1 views1 page

Code Gs

The document contains a script for Google Sheets that defines two functions: Simpan and bersih. The Simpan function retrieves data from the 'Input' sheet and saves it to the next available row in the 'Database' sheet, while the bersih function clears the input fields and resets certain values. This allows for efficient data entry and management within the spreadsheet.

Uploaded by

master_551993844
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views1 page

Code Gs

The document contains a script for Google Sheets that defines two functions: Simpan and bersih. The Simpan function retrieves data from the 'Input' sheet and saves it to the next available row in the 'Database' sheet, while the bersih function clears the input fields and resets certain values. This allows for efficient data entry and management within the spreadsheet.

Uploaded by

master_551993844
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

function Simpan() {

var Sheet = SpreadsheetApp.getActiveSpreadsheet();


var shtinput = Sheet.getSheetByName('Input');
var shtdb = Sheet.getSheetByName('Database');

var id = shtinput.getRange('D3').getValue();
var nama = shtinput.getRange('D5').getValue();
var tgl = shtinput.getRange('D7').getValue();
var alamat = shtinput.getRange('D9').getValue();
var sekolah = shtinput.getRange('D11').getValue();

var baris = shtdb.getRange('F1').getValue();


baris += 1;
var rangeisi = shtdb.getRange('A' + baris + ':E'+ baris);
rangeisi.setValues([[id,nama,tgl,alamat,sekolah]]);
bersih();
}

function bersih() {
var Sheet = SpreadsheetApp.getActiveSpreadsheet();
var shtinput = Sheet.getSheetByName('Input');

shtinput.getRange('D3').clearContent();
shtinput.getRange('D5').clearContent();
shtinput.getRange('D7').setValue('1/1/2000');
shtinput.getRange('D9').clearContent();
shtinput.getRange('D11').clearContent();
}

You might also like