Relative Content

Tag Archive for exceloffice-scripts

Set DataValidation in a list of columns at once

I’m trying to rewrite some old VBA code to Office Script.
One of the steps is to set data validation on several columns.
With the script I am able to loop all columns of a named table.
So my idea was to use a switch on the column names to set the related data validation.
So far so good – but: all defined rules set in the ForEach loop are somehow not done when calling the setRule() but all columns do have afterwards the last defined rule (here: the one from column name “Lagerstatus”.
Does anyone knows how to solve this problem?
Thanks in advance!
Best regeards,
Pascal

Excel Office Script

I’m not even sure if this is possible but I am trying to write an Office Script to copy the contents of one table and paste it to a new file and save it. The script I’m using I got some help from ChatGPT: