I got the following code to shuffle multiple columns with a script.
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName('SheetToShuffle');
var ranges = ['A1:A32','B1:B47','C1:C39','D1:D87'];
ranges.forEach(r => shuffleColumns(r, sheet));
function shuffleColumns(r, sheet) {
var range = sheet.getRange(r);
range.setValues(shuffleArray(range.getValues()));
}
The problem with this is that it shuffles the values of the cell instead of the formulas. Is there a way to change this? I want it to shuffle the cells, to keep the formulas in the cells.