Created
April 1, 2022 09:43
-
-
Save phillypb/409bfcb8e7d33b8023926cb3d1825bce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** * @OnlyCurrentDoc */ | |
function moveColumns() { | |
// get sheet | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
// select columns to be moved ('collegename' & 'shoesize') | |
var columnsToMove = sheet.getRange("E1:F1"); | |
// move columns to the left of 'postcode' | |
sheet.moveColumns(columnsToMove, 4); | |
} | |
/* | |
This Function creates a menu item to run this script. | |
*/ | |
function onOpen() { | |
SpreadsheetApp.getUi() | |
.createMenu('Admin') | |
.addItem('Move Columns', 'moveColumns') // label for menu item, name of function to run. | |
.addToUi(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment