0

As the title states, I am trying to create a Google Sheets Macro to replace "50" with "50+" and replace "49" with "<50" in Column E only within a sheet name "Cafe". I have been searching and searching and have found some examples that are close but have not been able to get them to work for me yet. So if some bright spark out there could provide some code to get me started, it would be appreciated.

Update: Thank you one and all for responses, I have followed the lead from PEH and ended up copying and trying the following code which is elegantly simple from an individual known as ADW, BUT I am getting a Syntax error: Invalid or unexpected token for this line of code

var textFinder = range.createTextFinder(‘50’);

Anybody got a solution?

function FandRV3() {
    var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
    var range = spreadsheet.getRange("E:E");
    var textFinder = range.createTextFinder(‘50’);
    textFinder.replaceAllWith(‘50+’);
};
Woftae
  • 11
  • 1
  • 3
  • ...press CTRL+H – player0 Apr 08 '21 at 00:32
  • Thanks for the response player0 but CTRL+H is the keyboard shortcut, I am looking for the code to execute via a macro – Woftae Apr 08 '21 at 02:10
  • 2
    Does this answer your question? [How to replace text in Google Spreadsheet using App Scripts?](https://stackoverflow.com/questions/19877554/how-to-replace-text-in-google-spreadsheet-using-app-scripts) – Pᴇʜ Apr 08 '21 at 06:17

0 Answers0