Google Sheet Thiết đặt công thức trên Apps script | Set Fomula on Apps script
Giaoan.link chia sẻ những hiểu biết về Google sheet và apps script, mong giúp được bạn trong những vấn đề bạn cần. Sau đây là project “Google Sheet Thiết đặt công thức trên Apps script (Set Fomula on Apps script). Đây là cách các bạn sử dụng hàm của Google sheet trong hàm của apps script. Việc này sẻ giúp bạn xử lí nhanh chóng hơn trong công việc.
Các bài học excel ứng dụng khác:
- Web App Script CSS JS | Tạo hiệu ứng Click button Nổ tung các mảnh giấy và chuyển link
- Web App Script CSS | Tạo button Liên hệ gồm 3 option đẹp mắt cho trang web
- Web App Script Webapp | Hiệu ứng hoa rơi – Form nhập liệu Gửi nội dung đến email
- Web App Script | Thanh trạng thái Status bar – Giá trị thể hiện theo điểm và label.
- Google sheet Apps script | Data Entry Form – Tự động đọc số tiền thành chữ ở trường input
- Google sheet Apps script | Cập nhật điểm lớp học – Theo danh sách lớp và Theo từng học sinh
- Google sheet, apps script Định dạng dấu phân cách hàng ngàn cho input
- Google sheet apps script | Chọn năm và kiểu biểu đồ để Load dữ liệu lên website
- Google sheet apps script | Scan QR code – Filter and get data table display on webapp
- Google sheet apps script Filter to get data to display on webapp, fill background color for data row
Mã code.gs
function onOpen(){
let ui=SpreadsheetApp.getUi();
ui.createMenu('THỰC THI HÀM')
.addItem('Tính tổng','setSum')
.addToUi();
}
function setSum() {
let ws=SpreadsheetApp.getActiveSpreadsheet();
let ss=ws.getActiveSheet();
let totalCell=ss.getRange('A12');
totalCell.setValue('Tổng cộng:');
totalCell.setFontWeight("bold");
let sumCell=ss.getRange('B12');
sumCell.setFormula('=sum(B2:B11)');
sumCell.setFontStyle('italic');
sumCell.setFontWeight('bold');
sumCell.setFontColor('red');
}