After Comparing 2 workbooks/datatables

Hello all… I have compared two datatables. A results datatable and a Reference Sheet datatable. I need to write the date for the matched items from both datatables to the row in the reference sheet datatable under a different column but corresponds to that item and itereate to the next cell that may or may not be the next cell. Does anyone have any ideas on how to achieve this? i have searched the forum to no avail.
Thanks

Hi @lharris

Use multiple for each row in datatables use if activity row(“Column Name”).ToString

Thanks
ashwin.S

hi @AshwinS2

what is working for me so far:

  1. Read Results Spreadsheet - UpdDT
  2. Read Reference Sheet -UpdRefDT
  3. For each row -row1 in UpdDT
    For each row -row2 in UpdRefDT
    If -row1(“ATM Number”).ToString = row2(“ATMNumber”).ToString
    then - write cell in Ref sheet - write -row1(“Reconciliation Date”).toString

I need to write the date from the Reconcilement Date column for that matched item to the column J or column named “Last Date Serviced”. When i run the automation it will not write to the right column that matches.

1 Like
  1. Read Results Spreadsheet - UpdDT
  2. Read Reference Sheet -UpdRefDT
  3. For each row -row1 in UpdDT
    For each row -row2 in UpdRefDT
    If -row1(“ATM Number”).ToString = row2(“ATMNumber”).ToString

then -

in "excel scope activity"

assign 
i = (UpdRefDT.Rows.IndexOf(row2)+1)

write range
mention Range as "J"&I+1                     since you want to update date in "J" column
Input value = row1

it will not let me write the range as row1. The error says data row cannot be converted to datatable

i have it working now… Thanks

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.