Google Sheet Scripts

check rows for cell match in Google sheet Script

check rows for cell match in Google sheet Script The following describes on how to check rows for cell match in Google Sheet Script function onSearch() { var ss1 = SpreadsheetApp.getActiveSpreadsheet(); var sheet1 = ss1.getSheetByName("Main Sheet"), searchVal1 = sheet1.getRange("A1").getValue(), searchCol1 = sheet1.getRange('A2:A').getValues(); for (var i = 0, len = searchCol1.length; i < len; i++)...

Get position of sub string in Google Sheet script

Get position of sub string in Google Sheet script The following will demonstrate how to get position of sub string in google sheet script. The position can be a single character or sub string. In the following example, position of “@” character can be found using “indexof” function stringIndexOfTest1(){ var test_mail = "test@gmail.com"; var...

Create Custom menus in Google Sheet Script

Custom menus in Google Sheet Script The following is used to create custom menus in Google sheet script. The new menus can be quickly used to run the program. function onOpen() { var ui = SpreadsheetApp.getUi(); ui.createMenu('Custom Menu1') .addItem('First item1', 'menuItem11') .addSeparator() .addSubMenu(ui.createMenu('Sub-menu1') .addItem('Second item1', 'menuItem21')) .addToUi(); } function menuItem11() { SpreadsheetApp.getUi()  .alert('You clicked...

Paste Special Values in Google Sheet Script

Paste Special Values in Google Sheet Script The following will paste special values in Google Sheet Script. This avoids transferring the formats. Here contentOnly is set True. It is an important criterion. function moveValuesOnly() { var ss1 = SpreadsheetApp.getActiveSpreadsheet(); var source1 = ss1.getRange('Sheet1!A1:A3'); source1.copyTo(ss1.getRange('Sheet2!A1'), {contentsOnly: true}); //source1.clear(); } If there only one cell to...

Published On

December 2018
M T W T F S S
« Nov    
 12
3456789
10111213141516
17181920212223
24252627282930
31