Filter excel to get data of only first row

I have situation where i have " OR " condition with Company Name,Regd No, Partial Name ,Full Name . to fetch Column E and column F data.

If you see Column E and Column F have same data. i need to fetch only ID One and ID Two of first row.
can this be achieved ?? Please guide me…


Hi @Tabish_Faridi,

Follow the below steps.

  • Use Read range within Excel application scope.
  • Use Assign StringIDOne = Datatable1.Rows(1)(“ID One”).tostring
  • Use Assign StringIDTwo = Datatable1.Rows(1)(“ID Two”).tostring

This didn’t workout because those row i am getting after applying select query , so the value returning out of it is dataRow type from this data row how we can extract the value ??

Please reply…

If it is array of Datarow, use the below code.

  • Use Assign StringIDOne = arrDatarow(1)(“ID One”).tostring

Thanks Vivek, It is arr of dataRow but still it is not working…

Thanks for your quick reply.

You can use arrDataRow(1).Item("ID One").ToString

Are you getting any error