title: Sum up a row in excel using vb.net
body: <p>I have an excel spreadsheet.  I have summed up the columns, but now I need to sum up the individual totals across the row for a Grand total.  colums are P, Q, R, S, T.  Since there will always be a different number of rows for each worksheet I have gotten the last row of the data and I am adding 2 rows to it so that the total will be two rows down from the data.  I am putting the grand total in column B on the same row as the individual totals.   This is what I have at the moment.  Any help would be appreicated. </p>
  
  <pre><code>Dim r As Integer
  r = lastRow + 2
  orange = oSheet.Range("B" &amp; r)
  orange.Select()
  oSheet.Cells(r, "B").Formula = _
             "=SUM(P:" &amp; r + "Q:" &amp; r + "R:" &amp; r + "S:" &amp; r + "T:" &amp; r &amp; ")"
  </code></pre>
  
  <p>I am getting this error:  "Conversion from string "Q:" to type 'Double' is not valid.". </p>
  
  <p>Thanks!  Lora</p>