Transferring of columns such as Time In, Employee, Occupation, Code Number, Department, and Favorite Food

Good Day.

I am trying to transfer the rows from the following columns such as Time In, Employee, Occupation, Code Number, Department, and Favorite Food from Sheet1 to Sheet2 with condition that the Time In must be 27/7/2022 4:01:00 pm onwards.

This is the working file:
SampleExcelFile.xlsx (291.8 KB)

This is the desired output:

May I know the most efficient solution to automate this kind of process in a fast way? Thank you so much.

Best regards,
Robert

Hi @RobertRussell_Monsalud

=> Read Range Workbook
Output → dtSheet1

=> Use below syntax in Assign:

dtSheet2 = dtSheet1.AsEnumerable().Where(Function(row) DateTime.Parse(row("Time In").ToString()) >= DateTime.Parse("07/27/2022 4:01:00 PM")).CopyToDataTable()

=> Write Range Workbook dtSheet2 back to excel.

Regards

1 Like

Hi @vrdabberu

It worked. Thank you so much. I just have a follow-up question.

May I know how can I delete the rows from Sheet1 with the Time In (27/7/2022 4:01:00 pm onwards)?

Thank you.

Best regards,
Robert

Hi @RobertRussell_Monsalud

Since your first query is resolved please mark my post as solution. I will be helping you with the follow up question in the new post you have created.

Regards

1 Like

Hi @vrdabberu

I already marked it as a solution. Thank you so much. I really appreciate it.

Best regards,
Robert

1 Like

Than you @RobertRussell_Monsalud

Happy Automation!!

Hi @vrdabberu

May I know what would be the efficient solution for this inquiry (Deleting of rows for columns such as Time In, Employee, Occupation, Code Number, Department, and Favorite Food)? Thank you.

Best regards,
Robert

1 Like

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