Delete rows from spreadsheet using StudioX

Hi, I have an excel file where the headers start from row #10 of the file. It has 8 column headers at row #10. Out of the first 9 rows, 2 rows are merged and has some title like text data describing the file purpose. The rest 7 rows are just empty rows (not merged). I need to delete all the 9 rows using StudioX so that the header comes to row #1 from row #10 that presently it is at. I’m reading the Excel rows using For each row and then adding a condition 'Currentrow" column 1 is empty, then delete row (All visible rows), it only deletes one row. Can you please provide your views on how to delete the rows ?

Hi @Prinal_C … Have you tried this ?

image

@prasath17 so with your method the delete of the first 9 rows is not required inside the For Each Loop, right ?

@prasath17 This is another program. I have three Excel files running in For Each File in Folder loop. The files have only one sheet each. The sheet names in the Excel are of the format “ReconBook_Tek_mmddyyy”. The “ReconBook_Tek_” is common. mm/dd/yyyy will be different for each file. I want to make the “From” field generic like “ReconBook_Tek_*” and To as “ReconBook_Tek_Today’s date”. In the loop, how to use the Rename Sheet activity only once keeping the “From” and “To” having wild card chars ? I’m using asterisk and it is throwing error.

@Prinal_C …Yes …loop is not required for your case. Have you tried ?

For your 2nd question…you cannot add * because it is invalid. Even if you try manually excel won’t allow.

@prasath17 correct. It does not work. What’s the solution to this problem ? I’m trying to use the ProjectNote Book but still does not work in StudioX

@Prinal_C - which one you are talking about? Delete row or Renaming?? Rename with the * won’t work . there is no solution. You can use other acceptable sheet name characters like - " _ etc etc

@prasath17 delete row is working. The other question I’m still researching.

@Prinal_C - Okay. As I mentioned, you cannot add *, if you are ok with adding other character…I will work on sometimes later and if its working i will share the xaml.

@prasath17 any character is fine as long as it meets the requirements. Thank you!

@Prinal_C - Here you go…Rename_Sheet_MultipleFiles.zip (152.5 KB)

Run this workflow as is, you will see all the workbook sheets in the Files folders get renamed. Before running, you can check the sheet name too.

Hope this helps.

@prasath17 Thank you! Why can’t I see For Each Excel sheet activity in StudioX? Do I need to include a package ?

I updated the package. Thanks! Will try it out.

1 Like

It worked well. Thank you !

1 Like

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