i have excel sheet and inside it i have 2 columns need to compare this 2 and get the different value in new excel sheet
Please need support
Hi Mabbas,
1.Read the excel sheet to a datatable and build a new datatable to store the distinct values.
2. Use the condition ârow(0).ToString <> row(1).ToStringâ to compare the first 2 columns and find the distinct values.
3.Assign the row values to a new datatable which satisfies the condition.
4. Write the new datatable to an excel file.
Warm Regards,
Nimin
Hi nimin
Thanks for your support
please if you have (xaml) could you share with me to check the code i try but itâs not working
thanks dear
Main.xaml (10.3 KB)
Hi Nimin
can you check my code please there is a issue in For Each row
thanks for your support
Hi Mohamed,
You can write individual values to a new excel file by using âWrite Cellâ activity instead of âWrite Rangeâ activity.
Please go through the workflow.Mainmhmd.xaml (12.9 KB)
Warm Regards,
Nimin
Hi Nimin
realy thanks for your support not itâs working but still i got error we start the code and also what should the code to get the value not matching like (cint(row(0)) = cint(row(1))) this code if row 0 equel row 1 what the code if not equel because i try ( <> , != and !==) but itâs not working
Kindly check my code and excel sheet thanks dear for your support
Main.xaml (12.8 KB)
Vlookup.xlsx (9.0 KB)
Hi Mohamed,
This error is due to the comparison of an integer value with a null value. You can get rid of this issue by converting the cell value to string. Please use the condition ârow(0).ToString = row(1).ToStringâ in the if activity.
Warm regards,
Nimin
Hi Mohamed,
Also you can extract the distinct values by using the condition ârow(0).ToString <> row(1).ToStringâ
Thank you.
Thanks dear for your help
Hi Nimin
i have one more question now when utry this code with my data i found the data in colum 1 should match colum 2 i mean sort like the excel sheet send to you but if i want search value from column 1 in column 2 and if i found this value itâs ok if i donât found it i need to copy in different column
like this excel
thanks dear for your support
Main.xaml (13.2 KB)
Vlookup.xlsx (9.1 KB)
Hi Mohamed,
I donât get your requirement exactly. What I understand is, If the first 2 columns does not matches, you need to write these columns in an excel file, like what is in your attached workflow now. Likewise, you also need to write the mismatched items in that excel file. Is it right? If so, just write the matched cell values to the excel file in the âelseâ section of the âif activityâ. Please refer the screenshot. Create a new counter variable(int32) to hold the row index.
In the range value of the âwrite cellâ activity, use â âCâ+ counter.ToString â and â âDâ+ counter.ToStringâ to start writing the values on C & D Columns.
Warm Regards,
Nimin
i mean now in column 1 you will find number 1 and also you will find the same number in column 2 that mean in both column i have this number that mean i donât want this value , and now like number 20 i have this in column 1 but i donât have it in column 2 that mean i want this value and this the diffrent between column 1 and 2
thanks dear for your support
i hope this phote expline my issue now
Hi Mohamed,
Please check the workflow. I hope it will meet your requirement.
Main2_abs.xaml (13.3 KB)
Warm regards,
Nimin
Thanks Thanks Thanks dear yeah now working as i want thanks for your support
Hi nimin
Realy thanks for your help and support me
please dear i have question not if i want to delete value satart with (P OR S) form column could you check my Xaml code because that i face issue in assin
Main.xaml (8.5 KB)
thanks dear for your help
Hii Mohamed,
Please go through this workflow. Remove_Conditional_Row.xaml (10.8 KB)
This will remove rows containing in the âResultâ column, in which the cell starts with P or S.
Warm Regards,
Nimin