Excel Automation to get specific data

@shruti, Follow these steps,

  1. Read Range - Output to a datatable (Say dt)

  2. Assign - Find the index of your desired first row (here PO NUMBER, MODEL,QTY…)
    integer Count = dt.Rows.IndexOf((From row in dt.Select() Where String.Join(“”,row.ItemArray()).Contains(“PO NUMBER”) Select row).ToArray()(0))

  3. Assign - Extract from that index till last row of datatable dt
    datatable dtFinal = (From row in dt.Select() Select row).Skip(Count).Take(dt.Rows.Count - Count).CopyToDatatable()

  4. Now use this dtFinal to output it in another sheet as per your need

Regards,
Dominic :slight_smile:

6 Likes