title: Create Random Invoice Generator
body: <p>I have created a google sheet that contains a button that when clicked will create a random number in a particular column. However, I need the code to find the first empty cell in the column for the random number. The code I am currently using fills all the cells in the row verses one cell at a time when the button is clicked. </p>
  
  <pre><code>function onOpen() {
    var sheet = SpreadsheetApp.getActiveSpreadsheet();
    var entries = [ {name:"Resubmit",functionName:"Resubmit"} ];
    sheet.addMenu("Script", entries);
  };
  
  function Resubmit() {
    var ss = SpreadsheetApp.getActiveSpreadsheet();
    var sheet = ss.getSheetByName("Sheet1");
    var cell = sheet.getRange("A:A");
    cell.setValue( Math.floor((Math.random()*1000000)+1) );
  
  };
  </code></pre>