I would like to use Office Script to change the title of a PT dataHierarchy field. Specifically, the user is choosing a range of dates, the automation script I created populates the PT with the dates but the title includes "Sum of date" I would like to remove the words "Sum of" and leave " date" I can do this easily with VBA but the online version of excel uses Office Script. I tried recording the steps but the script it created hard-coded the cell. Any suggestions?
function main(workbook: ExcelScript.Workbook) {
let selectedSheet = workbook.getActiveWorksheet();
// Set range H9 on selectedSheet
selectedSheet.getRange("H9").setValue(" 25Jul22");
}
function main(workbook: ExcelScript.Workbook) {
let selectedSheet = workbook.getActiveWorksheet();
// Set range H9 on selectedSheet
selectedSheet.getRange("H9").setValue(" 25Jul22");
}