How can I delete all rows in an excel file up until a break in the data

Hi all, I need to scan through many files in a folder and delete all of the information in the “REPORT: PBR200” section (A1) as seen below. My issue is at times there are 6 rows under this section and sometimes 25+. Is there a way to delete rows until the blank space that separates the sections?

Read Range to get the data into a datatable.

For Each Row in Datatable and find the index of the blank row.

Delete the rows that have an index less than the blank row.

Write back to a new Excel file.

1 Like

Will give this a shot, thanks a lot

DT.Asenumerable.SkipWhile(Function(r) Not String.IsNullorEmpty(String.Join(“”,r.itemarray))).Copytodatatable