title: Add 1 to each cell in every row of two columns until a blank cell is reached - Google Spreadsheet
body: <p>All I'm looking to do is add 1 to a range of cells until it reaches a blank cell. I'm also minus 1 from a another range of cells until it reaches a blank cell. I've currently codded each cell individually but the number of cells with data in changes so isn't really practical.</p>
  
  <p>Here is an extract of code I have written can anyone help me?</p>
  
  <pre><code>function Calculations() {
    //Week Number &amp; Week Pay
    var spreadsheet = SpreadsheetApp.getActiveSpreadsheet()
    s=SpreadsheetApp.setActiveSheet(spreadsheet.getSheetByName("Money")
  
    var currVal=s.getRange("C2").getValue()
    var plusVal= currVal +1
    s.getRange("C2") .setValue(plusVal)
    var currVal=s.getRange("B2").getValue()
    var minusVal= currVal -1
    s.getRange("B2") .setValue(minusVal)
  
    var currVal=s.getRange("C3").getValue()
    var plusVal= currVal +1
    s.getRange("C3") .setValue(plusVal)
    var currVal=s.getRange("B3").getValue()
    var minusVal= currVal -1
    s.getRange("B3") .setValue(minusVal)
  
    var currVal=s.getRange("C4").getValue()
    var plusVal= currVal +1
    s.getRange("C4") .setValue(plusVal)
    var currVal=s.getRange("B4").getValue()
    var minusVal= currVal -1
    s.getRange("B4") .setValue(minusVal)
  }
  </code></pre>