title: Finding column number of a cell with specific value
body: <p>I currently have a code that can get the row number of a cell that contains a specific string. Here's an example of the code:  </p>
  
  <pre><code>var ss = SpreadsheetApp.getActiveSheet();
  var values = ss.getRange("B:B").getValues();
  var i=j=firstrow=lastrow=0;
  for(i=0;i&lt;values.length;i++)
  for(j=0;j&lt;values[i].length;j++) {
    if(values[i][j]==5100) firstrow=i+1;
  else if(values[i][j]=='EOL') lastrow=i-2;
  }
  </code></pre>
  
  <p>I was wondering if it's possible to do something like above, but for columns, that way my script will not fall apart if an user accidentally move a column.</p>