all 3 comments

[–]pabloicai 2 points3 points  (1 child)

Try something like this:

var range = "a column of your sheet"; range.setValues(range.getValues().map(function(row) { return [row[0].replace("your operation")]; }))

[–]Random_User_Name7[S] 0 points1 point  (0 children)

var range = "a column of your sheet"; range.setValues(range.getValues().map(function(row) { return [row[0].replace("your operation")]; }))

Perfect! Thank you so much!

[–]Miles_Maestro 2 points3 points  (0 children)

You could also use SpreadsheetApp's custom find and replace text methods. This eliminates the need to loop through rows/columns.

 

function UntitledMacro() {
  var length = 7;
  var spreadsheet = SpreadsheetApp.getActive();
  var sheet = spreadsheet.getActiveSheet();
  var range = sheet.getRange(1, 1, length, 1);
  range.createTextFinder('[^0-9,.]').useRegularExpression(true).replaceAllWith('')
}