Skip to main content
added 5 characters in body
Source Link
user0
  • 27.1k
  • 10
  • 53
  • 78

It looks like this issue is due to a bug in the new Google Sheets, but you can use this simple script as a workaround.

  • In your sheet, go to Tools > Script Editor. Erase the existing code in Code.gs and add this instead:

      function setCellAlign(range, alignment) {
         var ss = SpreadsheetApp.getActiveSpreadsheet();
         var sheet = ss.getSheets()[0];
         var cell = sheet.getRange(range);
         cell.setHorizontalAlignment(alignment);
       }
      function onFormSubmit() {
         setCellAlign("A1:F500", "center");
      }
    
  • In the second-to-last-line, change F500 to the expected bottom-right cell of your sheet. For example, if your rightmost column is G and you want to hold 1000 responses in your sheet, change the value to G1000 so the second-to-last line is setCellAlign("A1:G1000", "center");
  • Save the script project as "AutoAlign"

  • Within the Script Editor, go to Resources > Current project's triggers. Add a new trigger for onFormSubmit, From the spreadsheet, On form submit, and press "Save."

Your responses should now align automatically to the center. For whatever reason, this script fails to work 1% of the time, but if that happens the next form submission will fix the previous row.

It looks like this issue is due to a bug in the new Google Sheets, but you can use this simple script as a workaround.

  • In your sheet, go to Tools > Script Editor. Erase the existing code in Code.gs and add this instead:

      function setCellAlign(range, alignment) {
         var ss = SpreadsheetApp.getActiveSpreadsheet();
         var sheet = ss.getSheets()[0];
         var cell = sheet.getRange(range);
         cell.setHorizontalAlignment(alignment);
       }
      function onFormSubmit() {
         setCellAlign("A1:F500", "center");
      }
    
  • In the second-to-last-line, change F500 to the expected bottom-right cell of your sheet. For example, if your rightmost column is G and you want to hold 1000 responses in your sheet, change the value to G1000 so the second-to-last line is setCellAlign("A1:G1000", "center");
  • Save the script project as "AutoAlign"

  • Within the Script Editor, go to Resources > Current project's triggers. Add a new trigger for onFormSubmit, From spreadsheet, On form submit, and press "Save."

Your responses should now align automatically to the center. For whatever reason this script fails to work 1% of the time, but if that happens the next form submission will fix the previous row.

It looks like this issue is due to a bug in the new Google Sheets, but you can use this simple script as a workaround.

  • In your sheet, go to Tools > Script Editor. Erase the existing code in Code.gs and add this instead:

      function setCellAlign(range, alignment) {
         var ss = SpreadsheetApp.getActiveSpreadsheet();
         var sheet = ss.getSheets()[0];
         var cell = sheet.getRange(range);
         cell.setHorizontalAlignment(alignment);
       }
      function onFormSubmit() {
         setCellAlign("A1:F500", "center");
      }
    
  • In the second-to-last-line, change F500 to the expected bottom-right cell of your sheet. For example, if your rightmost column is G and you want to hold 1000 responses in your sheet, change the value to G1000 so the second-to-last line is setCellAlign("A1:G1000", "center");
  • Save the script project as "AutoAlign"

  • Within the Script Editor, go to Resources > Current project's triggers. Add a new trigger for onFormSubmit, From the spreadsheet, On form submit, and press "Save."

Your responses should now align automatically to the center. For whatever reason, this script fails to work 1% of the time, but if that happens the next form submission will fix the previous row.

replaced inline formatting with code block
Source Link
ale
  • 52.9k
  • 42
  • 165
  • 314

It looks like this issue is due to a bug in the new Google Sheets, but you can use this simple script as a workaround.

  • In your sheet, go to Tools > Script Editor. Erase the existing code in Code.gs and add this instead:

    In your sheet, go to Tools > Script Editor. Erase the existing code in Code.gs and add this instead:

      function setCellAlign(range, alignment) {
         var ss = SpreadsheetApp.getActiveSpreadsheet();
         var sheet = ss.getSheets()[0];
         var cell = sheet.getRange(range);
         cell.setHorizontalAlignment(alignment);
       }
      function onFormSubmit() {
         setCellAlign("A1:F500", "center");
      }
    
function setCellAlign(range, alignment) {
   var ss = SpreadsheetApp.getActiveSpreadsheet();
   var sheet = ss.getSheets()[0];
   var cell = sheet.getRange(range);
   cell.setHorizontalAlignment(alignment);
 }
function onFormSubmit() {
   setCellAlign("A1:F500", "center");
}
  • In the second-to-last-line, change F500 to the expected bottom-right cell of your sheet. For example, if your rightmost column is G and you want to hold 1000 responses in your sheet, change the value to G1000 so the second-to-last line is setCellAlign("A1:G1000", "center");
  • Save the script project as "AutoAlign"

  • Within the Script Editor, go to Resources > Current project's triggers. Add a new trigger for onFormSubmit, From spreadsheet, On form submit, and press "Save."

Your responses should now align automatically to the center. For whatever reason this script fails to work 1% of the time, but if that happens the next form submission will fix the previous row.

It looks like this issue is due to a bug in the new Google Sheets, but you can use this simple script as a workaround.

  • In your sheet, go to Tools > Script Editor. Erase the existing code in Code.gs and add this instead:
function setCellAlign(range, alignment) {
   var ss = SpreadsheetApp.getActiveSpreadsheet();
   var sheet = ss.getSheets()[0];
   var cell = sheet.getRange(range);
   cell.setHorizontalAlignment(alignment);
 }
function onFormSubmit() {
   setCellAlign("A1:F500", "center");
}
  • In the second-to-last-line, change F500 to the expected bottom-right cell of your sheet. For example, if your rightmost column is G and you want to hold 1000 responses in your sheet, change the value to G1000 so the second-to-last line is setCellAlign("A1:G1000", "center");
  • Save the script project as "AutoAlign"

  • Within the Script Editor, go to Resources > Current project's triggers. Add a new trigger for onFormSubmit, From spreadsheet, On form submit, and press "Save."

Your responses should now align automatically to the center. For whatever reason this script fails to work 1% of the time, but if that happens the next form submission will fix the previous row.

It looks like this issue is due to a bug in the new Google Sheets, but you can use this simple script as a workaround.

  • In your sheet, go to Tools > Script Editor. Erase the existing code in Code.gs and add this instead:

      function setCellAlign(range, alignment) {
         var ss = SpreadsheetApp.getActiveSpreadsheet();
         var sheet = ss.getSheets()[0];
         var cell = sheet.getRange(range);
         cell.setHorizontalAlignment(alignment);
       }
      function onFormSubmit() {
         setCellAlign("A1:F500", "center");
      }
    
  • In the second-to-last-line, change F500 to the expected bottom-right cell of your sheet. For example, if your rightmost column is G and you want to hold 1000 responses in your sheet, change the value to G1000 so the second-to-last line is setCellAlign("A1:G1000", "center");
  • Save the script project as "AutoAlign"

  • Within the Script Editor, go to Resources > Current project's triggers. Add a new trigger for onFormSubmit, From spreadsheet, On form submit, and press "Save."

Your responses should now align automatically to the center. For whatever reason this script fails to work 1% of the time, but if that happens the next form submission will fix the previous row.

replaced inline formatting with code block
Source Link

It looks like this issue is due to a bug in the new Google Sheets, but you can use this simple script as a workaround.

  • In your sheet, go to Tools > Script Editor. Erase the existing code in Code.gs and add this instead:

function setCellAlign(range, alignment) { var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; var cell = sheet.getRange(range); cell.setHorizontalAlignment(alignment); } function onFormSubmit() { setCellAlign("A1:F500", "center"); }

function setCellAlign(range, alignment) {
   var ss = SpreadsheetApp.getActiveSpreadsheet();
   var sheet = ss.getSheets()[0];
   var cell = sheet.getRange(range);
   cell.setHorizontalAlignment(alignment);
 }
function onFormSubmit() {
   setCellAlign("A1:F500", "center");
}
  • In the second-to-last-line, change F500 to the expected bottom-right cell of your sheet. For example, if your rightmost column is G and you want to hold 1000 responses in your sheet, change the value to G1000 so the second-to-last line is setCellAlign("A1:G1000", "center");
  • Save the script project as "AutoAlign"

  • Within the Script Editor, go to Resources > Current project's triggers. Add a new trigger for onFormSubmit, From spreadsheet, On form submit, and press "Save."

Your responses should now align automatically to the center. For whatever reason this script fails to work 1% of the time, but if that happens the next form submission will fix the previous row.

It looks like this issue is due to a bug in the new Google Sheets, but you can use this simple script as a workaround.

  • In your sheet, go to Tools > Script Editor. Erase the existing code in Code.gs and add this instead:

function setCellAlign(range, alignment) { var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; var cell = sheet.getRange(range); cell.setHorizontalAlignment(alignment); } function onFormSubmit() { setCellAlign("A1:F500", "center"); }

  • In the second-to-last-line, change F500 to the expected bottom-right cell of your sheet. For example, if your rightmost column is G and you want to hold 1000 responses in your sheet, change the value to G1000 so the second-to-last line is setCellAlign("A1:G1000", "center");
  • Save the script project as "AutoAlign"

  • Within the Script Editor, go to Resources > Current project's triggers. Add a new trigger for onFormSubmit, From spreadsheet, On form submit, and press "Save."

Your responses should now align automatically to the center. For whatever reason this script fails to work 1% of the time, but if that happens the next form submission will fix the previous row.

It looks like this issue is due to a bug in the new Google Sheets, but you can use this simple script as a workaround.

  • In your sheet, go to Tools > Script Editor. Erase the existing code in Code.gs and add this instead:
function setCellAlign(range, alignment) {
   var ss = SpreadsheetApp.getActiveSpreadsheet();
   var sheet = ss.getSheets()[0];
   var cell = sheet.getRange(range);
   cell.setHorizontalAlignment(alignment);
 }
function onFormSubmit() {
   setCellAlign("A1:F500", "center");
}
  • In the second-to-last-line, change F500 to the expected bottom-right cell of your sheet. For example, if your rightmost column is G and you want to hold 1000 responses in your sheet, change the value to G1000 so the second-to-last line is setCellAlign("A1:G1000", "center");
  • Save the script project as "AutoAlign"

  • Within the Script Editor, go to Resources > Current project's triggers. Add a new trigger for onFormSubmit, From spreadsheet, On form submit, and press "Save."

Your responses should now align automatically to the center. For whatever reason this script fails to work 1% of the time, but if that happens the next form submission will fix the previous row.

Source Link
Loading