How can I extract data in between without specifying the exact cell position?

Hi! How can I extract the rows between Class A and standard without specifying the exact cell position then write it to another excel sheet? Next, repeat the process again for Class B. Thank You.

Hi @Krystal ,

Would you be so kind as to make this sample template available to us so that we can run some tests and come up with an end-to-end resolution?

Kind Regards,
Ashwin A.K

file.xlsx (9.4 KB)

Hi @Krystal ,

Is this the expected output?

image

image

SplitExcelDataFromSingleSheet.xaml (11.8 KB)

Kind Regards,
Ashwin A.K

Thanks a lot. This is what I want. But instead of writing it one by one, is it possible to do it in a faster way because I have a lot more data afterwards?

And I have another question, if I only want to extract columns A (if column A is empty then need to extract column B)and C further to a new sheet, how to get this done?

Below is the expected output.

image

Hi

Hope the below steps would help you resolve this

  1. Use a excel application scope and pass filepath as input and inside the scope use a read range activity and get the output as dt

  2. Then use a Build datatable activity and create two columns named “Name” and “Value” and get the output as Finaldt

  3. Use a clear datatable activity and pass Finaldt as input

  4. Then use a For each row activity and pass dt as input

  5. Inside the loop use a If condition like this

NOT String.IsNullOrEmpty(CurrentRow(0).ToString.Trim)

If true it goes to then block where use a ADD DATAROW activity and mention datatable as Finaldt and array row as {Currentrow(0).ToString, CurrentRow(2).ToString}

If false which means first column has null value then it goes to else block where use a add Datarow activity like this
{Currentrow(1).ToString, CurrentRow(2).ToString}

  1. Now outside the loop use a WRITE RANGE activity and pass Finaldt as input and this will contain the value you need

This can be repeated for class B as well

Cheers @Krystal

1 Like

Hi @Krystal ,

Then you could pass in an array of the classes you want to extract like so:

image

image

As for speeding up the writing process, that won’t be possible since each dataset has to end up in a separate Excel File.

SplitExcelDataFromSingleSheet_v1.xaml (18.5 KB)

Kind Regards,
Ashwin A.K

1 Like

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