title: Run function on 1 sheet only instead of .forEach
body: <p>I believe this will be a super easy question for you. I downloaded a YT script to automatically update YT views on Google Sheets which you can find here (<a href="https://developers.google.com/gsuite/solutions/youtube-tracker" rel="nofollow noreferrer">https://developers.google.com/gsuite/solutions/youtube-tracker</a>).</p>
  <p>I have a spreadsheet with 12 tabs and the code has a function to go through every tab in the spreadsheet.</p>
  <pre><code>function markVideos() {
    var ss = SpreadsheetApp.getActiveSpreadsheet();
    var sheets = SpreadsheetApp.getActiveSpreadsheet().getSheets();
    
    // Runs through process for each tab in Spreadsheet.
    sheets.forEach(function(dataSheet) {
      var tabName = dataSheet.getName();
      var range = dataSheet.getDataRange();
      var numRows = range.getNumRows();
      var rows = range.getValues();
      var headerRow = rows[0]; 
  </code></pre>
  <p>I want to change it to apply to a specific tab only, let's say &quot;Sheet12&quot;, instead of running it for every tab.</p>
  <pre><code>function markVideos() {
    var ss = SpreadsheetApp.getActiveSpreadsheet();
    var sheets = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(&quot;Sheet12&quot;);
    
    // Runs through process for each tab in Spreadsheet.
    function NameOfTheFunction(dataSheet) {
      var tabName = dataSheet.getName();
      var range = dataSheet.getDataRange();
      var numRows = range.getNumRows();
      var rows = range.getValues();
      var headerRow = rows[0]; 
  </code></pre>
  <p>I tried this but had no luck because it doesn't seem to be applying the function to the specific sheet. I believe this is super easy fix but I have no idea about programming.</p>