Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

159
Vistas
Removing leading and trailing quotation marks in Google Sheets / Apps script

I am writing a script to populate a cell with some information for a mailer. I'm fairly new to this, so am guessing the coding isn't perfect. However, all I really need to achieve is to get a block of text - and it's pretty much there.

The problem is, that when it returns the text it adds a qutoation at start and at the end.

Can someone let me know how to return the text without this.

function MailerText(strMailer, strName) {
  
  if (strMailer === undefined || strMailer === "Ignore") {return ""};
  
  let  varBody
  let  ss = SpreadsheetApp.getActiveSpreadsheet();
  var formS = ss.getSheetByName("Actions");

  
  if (strMailer == 'A Style English') {varBody = formS.getRange('C1').getValue(); varSalutation = formS.getRange('B1').getValue();}
  else if (strMailer == 'A Style German - Female') {varBody = formS.getRange('C2').getValue(); varSalutation = formS.getRange('B2').getValue();};
  
  if (varBody == undefined) {return ""};
  return varSalutation + ' ' + strName + ',' + "\n" + "\n" + varBody; 

}

As requested, here are a few screen shots of the issue:

Image 1: The function call from the cell

Image 2: How it looks in Sheets after the function call

Image 3: What you get when you copy/paste the text into something.

The function call from the cell

How it looks in Sheets

When you copy the cell and paste it into something, you have the quotation marks

about 4 years ago · Santiago Gelvez
1 Respuestas
Responde la pregunta

0

In this case after researching for a while it seems that whenever Sheets detects that there are special characters or line breaks you will get the quotation marks added when the text is copied, there is a similar post about this behavior and it contains a good workaround if you don't mind copying the text to a different cell then you can try this formula on another cell:

=SUBSTITUTE(C609,char(10),char(13))

This would basically copy the text without the special characters on it and when copy/pasted from the cell where the formula is added then you will see that the quotations will no longer be there.

about 4 years ago · Santiago Gelvez Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda