CopyPaste data with calculation from sheet2 to sheet1

Hi Friends,

I have DailyBilling & MasterBilling sheet. I have to copy data as per date from DailyBilling and paste in MasterBilling Sheet. Also in DailyBilling sheet have YES, NO but we need to add both column data in total column in MasterBilling sheet. Now Jan 06 data need to copy paste in masterbilling sheet. Find the sample sheet.
I am using RE.

Please share best approach for this scenario.
Copaypastewithsum Query.xlsx (9.2 KB)

Hi @Jeeru_venkat_Rao

Try to use this in invoke code activity

Dim filteredRows = dtDailyBilling.AsEnumerable().Where(Function(row) 
Dim dateValue As DateTime 
Return DateTime.TryParse(row("Bot Run Date").ToString(), dateValue) AndAlso dateValue.Date = DateTime.Now.Date 
End Function)
If filteredRows.Any() Then
Dim filteredDataTable As DataTable = dtMasterBilling.Clone

For Each row As DataRow In filteredRows 
	filteredDataTable.Rows.Add({ row("Bot Run Date"), row("Insurance"), CDbl(row("YES")) + CDbl(row("NO")), row("Total Patients"), row("Success"), row("Exception")})
Next
dtMasterBilling.Merge(filteredDataTable, True, MissingSchemaAction.Add)
End If

Thank you @rashmisingh2695

You are awesome. Its working fine.

1 Like

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