Simple enough, I want to add "navigatela.lacity.org/" to the beginning of each cell in column G programmatically (bar the header). What different ways could I go about doing this?
Thank you! Your help is greatly appreciated :D
I believe your goal is as follows.
navigatela.lacity.org/
to the top of the value in the column "G".In this case, how about the following sample script?
function myFunction() {
const add = "navigatela.lacity.org/"; // This is from your question.
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet1"); // Please set your sheet name.
sheet.getRange("G2:G" + sheet.getLastRow()).createTextFinder("(^.*$)").useRegularExpression(true).replaceAllWith(`${add}$1`);
}
navigatela.lacity.org/
is added to the top of the value in the column "G". In this case, this text is not added to the empty cells.