title: Subtraction between to excel column using VBScript
body: <p>Suppose I have below excel sheet,And I need to find the difference between them and result need to put back to another column:</p>
  
  <pre><code>      ColA                      ColB                    ColC
  
  9/3/2012  8:31:59 AM      09/17/2012  6:45:56 PM        Result
  9/4/2012  8:31:59 AM      10/17/2012  6:45:56 PM        Result
  </code></pre>
  
  <p>I did it using Loop and Row-By-Row technique. Looking for a way if it can be done directly by column level subtraction. Say ColB-ColA - > ColC. The whole operation should be performed at a time.Result should come <strong><em>"hh:mm:ss"</em></strong>.</p>
  
  <p><strong><em>CODE</em></strong></p>
  
  <pre><code>  IntRow4=2
    Do While objSheet4.Cells(IntRow4,1).Value &lt;&gt; ""
  
      If objSheet4.Cells(IntRow4,9).Value &lt;&gt; "Open" Then
  
         Date1=objSheet4.Cells(IntRow4,7).Value
         Date2=objSheet4.Cells(IntRow4,8).Value
         objSheet4.Cells(IntRow4,11)=TimeSpan(Date1,Date2)
  
     End If
  
    IntRow4=IntRow4+1
    Loop
  </code></pre>
  
  <p><strong><em>Update</em></strong></p>
  
  <pre><code>      ColA1    ColB1      ColC1       ColA2    ColB2     ColC2   .....   ColAN    ColBN    ColCN    TotaltimeDurtion
        Date     Date     11:25:20      Date     Date     10:25:00          Date    Date     11:25:20      ?
  </code></pre>
  
  <p><strong><em>here i have shown only one row,But there can be multiple or N number of rows.What I need to do is,I want to add the time durations and put them to the last colum "TotaltimeDurtion".But the last column can not be fixed.And all the columns for each row shouldn't required values,but all never will be empty.Can we also do this also in column level.here the duration is hh:mm:ss format or as per your instruction [h]:mm:ss. TotaltimeDurtion &lt;- ColC1  + ColC2 + ...+ ColCN.</em></strong></p>