LoginSignup
0
1

More than 3 years have passed since last update.

GAS:リストをもとに、テンプレートシートを複製し、シート名をリネームする

Posted at
qiita arrayPractice.js
const ThisSpread = SpreadsheetApp.getActiveSpreadsheet();

function createSheet(){
  const name_list = createNameList();
  Logger.log(name_list);
  const TemplateSheet = ThisSpread.getSheetByName('template');
  for (let name of name_list){
  const create_sheet = TemplateSheet.copyTo(ThisSpread);
  create_sheet.setName(name);
  }
}
function createNameList() {
  const name_list = [];
  const NamesSheet = ThisSpread.getSheetByName('names');
  for (row = 1; row <= 5; row ++){
  name_list.push(NamesSheet.getRange(row, 1).getValue());
  }
  //Logger.log(name_list);
  return name_list;
}
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1