title: Populate next empty cell with value above plus 1 until all rows are populated
body: <p>I am creating a spreadsheet for a point of sale system. On the 'sales' sheet I have a command button for when a sale is complete. When clicked all of the data from that sheet moves into another sheet 'today's sales' and I need help with vba code to assign a receipt number to each completed sale. The first sale of the day should be receipt no. 1 and each thereafter goes up by 1. Some of the code on that command button is as below:</p>
  
  <pre><code>Dim ReceiptNumber As Long
  
  ReceiptNumber = Sheets("Today's sales").Range("G" &amp; Rows.Count).End(xlUp).Value + 1
  
  For Each c In Sheets("Today's sales").Range("A:A")
  If c &lt;&gt; 0 And c.Offset(, 6) = 0 Then
  c.Offset(, 6) = ReceiptNumber
  End If
  Next
  </code></pre>
  
  <p>But this doesn't work for the first sale of the day because column G has a title 'receipt number' - the code can't add 1 to this value.</p>
  
  <p>Does anyone know a way to get around this? </p>