title: Google Sheets - Transpose Sheet Names
body: <p>I would like the list of sheet names to be transposed, so instead of starting at H4 and down the rows, they would be set from H4 and across the columns.</p>
  <p>I assume <code>sheet.getRange(&quot;H4:H&quot;).clear();</code> will need to change to <code>sheet.getRange(&quot;H4:4&quot;).clear();</code></p>
  <p>But I do not know how to change the rest of the code to achieve what I need.</p>
  <pre><code>function sheetNames() {
    const ss = SpreadsheetApp.getActive();
    const sheetNames = ss.getSheets().map(sheet =&gt; [sheet.getName()]);
    const sheet = ss.getSheetByName(&quot;Master&quot;);
    sheet.getRange(&quot;H4:H&quot;).clear();
    sheet.getRange(4,8,sheetNames.length).setValues(sheetNames);
  };
  </code></pre>
  <p>Again your help is much appreciated!</p>