Hi all, I am a volunteer for a charity, we have a foodbank, youthclub for boys and girls and various other classes.
We use a powerapp to do the register which populates "present" to each user(row) who is present to column name "Attendance". All I need is a script or macro that will create a column at the end with todays date and then cut the values from attendance to the new created column. I need this to run once a week which i can do via power automate.
I am by no means a coder but I did give it a good try. The below creates the column using today date.
function main(workbook: ExcelScript.Workbook) {
var today = new Date();
var dd = String(today.getDate()).padStart(2, '0');
var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
var yyyy = today.getFullYear();
let x = dd + '/' + mm + '/' + yyyy;
let sh = workbook.getActiveWorksheet()
let tbl = sh.getTable("FBRegister")
tbl.addColumn().setName(x)
}
the below is what doesn't work : m2:m170 being the current attendance column. is it possible to call a variable in get range?
fBRegister.getRange("M2:M170").moveTo(fBRegister.getRange("x"));
Any advise will be appreciated.
We use a powerapp to do the register which populates "present" to each user(row) who is present to column name "Attendance". All I need is a script or macro that will create a column at the end with todays date and then cut the values from attendance to the new created column. I need this to run once a week which i can do via power automate.
I am by no means a coder but I did give it a good try. The below creates the column using today date.
function main(workbook: ExcelScript.Workbook) {
var today = new Date();
var dd = String(today.getDate()).padStart(2, '0');
var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
var yyyy = today.getFullYear();
let x = dd + '/' + mm + '/' + yyyy;
let sh = workbook.getActiveWorksheet()
let tbl = sh.getTable("FBRegister")
tbl.addColumn().setName(x)
}
the below is what doesn't work : m2:m170 being the current attendance column. is it possible to call a variable in get range?
fBRegister.getRange("M2:M170").moveTo(fBRegister.getRange("x"));
Any advise will be appreciated.