bicutit
Search Sexy Womans from your city for night
- Tham gia
- 26/11/10
- Bài viết
- 58
- Được thích
- 2
- Giới tính
- Nam
- Nghề nghiệp
- Search
Chào các bác,
Hiện nay em đang dùng scripts ở phía dưới để tạo thêm 10 dòng ở phía dưới, và nội dung ở 10 dòng phía dưới giống hệt nội dung ở 10 dòng phía trên,
Tuy nhiên vì mỗi lần muốn thay đổi số dòng thì lại phải vào chỉnh sửa scripts
Sau đó em sửa lại thay vì c=10 thì gán giá trị mới vào c
Bây giờ em muốn mỗi lần mình nhập giá trị cần dùng vào ô D2 thì c sẽ bằng D2,
Nên em thay thế câu var c=10;
Bằng câu
var c = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().getRange("D2");
c.getValue();
Nhưng lệnh không chạy, các bác giúp em với ạ, em xin cảm ơn,
function themdongnew() {
var spreadsheet = SpreadsheetApp.getActive();
var currentCell = spreadsheet.getCurrentCell();
var c=10;
spreadsheet.setCurrentCell(currentCell);
spreadsheet.getActiveSheet().insertRowsAfter(spreadsheet.getActiveRange().getLastRow(), c);
var spreadsheet = SpreadsheetApp.getActive();
var currentCell = spreadsheet.getCurrentCell().offset(-1, 0);
spreadsheet.getCurrentCell().offset(-c, 0, c, 1).activate();
spreadsheet.setCurrentCell(currentCell);
currentCell = spreadsheet.getCurrentCell();
var sheet = spreadsheet.getActiveSheet();
sheet.getRange(spreadsheet.getCurrentCell().getRow() - c-1, 1, c, sheet.getMaxColumns()).activate();
currentCell.activateAsCurrentCell();
spreadsheet.getCurrentCell().offset(2, 0).activate();
sheet = spreadsheet.getActiveSheet();
sheet.getRange(spreadsheet.getCurrentCell().getRow() - (c+1), 1, c, sheet.getMaxColumns()).copyTo(spreadsheet.getActiveRange(), SpreadsheetApp.CopyPasteType.PASTE_VALUES, false);
spreadsheet.getCurrentCell().offset(c, 0).activate();
};
function ca_ô() {
var soLuot = 10;
var soDong = 30;
for (var i = 1; i++ <= soLuot; )
for (var i2 = 0; i2 < soDong; i2 += soDong) themdongnew();
}
Hiện nay em đang dùng scripts ở phía dưới để tạo thêm 10 dòng ở phía dưới, và nội dung ở 10 dòng phía dưới giống hệt nội dung ở 10 dòng phía trên,
Tuy nhiên vì mỗi lần muốn thay đổi số dòng thì lại phải vào chỉnh sửa scripts
Sau đó em sửa lại thay vì c=10 thì gán giá trị mới vào c
Bây giờ em muốn mỗi lần mình nhập giá trị cần dùng vào ô D2 thì c sẽ bằng D2,
Nên em thay thế câu var c=10;
Bằng câu
var c = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().getRange("D2");
c.getValue();
Nhưng lệnh không chạy, các bác giúp em với ạ, em xin cảm ơn,
function themdongnew() {
var spreadsheet = SpreadsheetApp.getActive();
var currentCell = spreadsheet.getCurrentCell();
var c=10;
spreadsheet.setCurrentCell(currentCell);
spreadsheet.getActiveSheet().insertRowsAfter(spreadsheet.getActiveRange().getLastRow(), c);
var spreadsheet = SpreadsheetApp.getActive();
var currentCell = spreadsheet.getCurrentCell().offset(-1, 0);
spreadsheet.getCurrentCell().offset(-c, 0, c, 1).activate();
spreadsheet.setCurrentCell(currentCell);
currentCell = spreadsheet.getCurrentCell();
var sheet = spreadsheet.getActiveSheet();
sheet.getRange(spreadsheet.getCurrentCell().getRow() - c-1, 1, c, sheet.getMaxColumns()).activate();
currentCell.activateAsCurrentCell();
spreadsheet.getCurrentCell().offset(2, 0).activate();
sheet = spreadsheet.getActiveSheet();
sheet.getRange(spreadsheet.getCurrentCell().getRow() - (c+1), 1, c, sheet.getMaxColumns()).copyTo(spreadsheet.getActiveRange(), SpreadsheetApp.CopyPasteType.PASTE_VALUES, false);
spreadsheet.getCurrentCell().offset(c, 0).activate();
};
function ca_ô() {
var soLuot = 10;
var soDong = 30;
for (var i = 1; i++ <= soLuot; )
for (var i2 = 0; i2 < soDong; i2 += soDong) themdongnew();
}
Lần chỉnh sửa cuối: