title: powershell code for comparing two xls files
body: <p>i'am stuck coding with below requirement.</p>
  
  <p>I have two excel(xls) files(old and new users list). In each file there are 4 fields "Userid", "UserName", "Costcenter", Approving Manager" . Now, i need to check whether each Userid from New user list exists in Old user list. If so, i have to copy/replace the  values of "Costcenter" and Approving Manager" in the New User list with the values from the same columns from Old user list. If this condition fails then hightlight the entire row for the "userid" in the New User List for which there is no corresponding matching record in the Old User list and finally not last but least we have to save the New user list. There are about 2000+ userid's</p>
  
  <p>below, i started of coding to get the Userid list from the New user list into an Array. will be doing the same for Old user list. From there on how do i go by modifying the new user list like i explained above?</p>
  
  <pre><code>$objExcel = new-object -comobject excel.application
  $UserWorkBook = $objExcel.Workbooks.Open("O:\UserCert\New_Users.xls")
  $UserWorksheet = $UserWorkBook.Worksheets.Item(1)
  $OldUsers = @()
  $intRow = 2 #starting from 2 since i have to exclude the header
  
  do {
  $OldUsers = $UserWorksheet.Cells.Item($intRow, 1).Value()
  $intRow++
  } while ($UserWorksheet.Cells.Item($intRow,1).Value() -ne $null)
  </code></pre>
  
  <p>Any help Greatly appreciated...</p>