How to get the cell number dynamically when the header changing for every file?

Hi All,

Could you please share any LINQ querry to get the header index value. when the header is dynamic( sometimes its starting from A1 sometimes from A4. but I need to use read range to store it into DataTable. How to do that?

Regards,
Ritesh

@Ritesh_Burman

If the rows before header are empty then in read range do not give any range details leave it blank or give only the sheetname and bot would ideally pick from the first available row

Cheers

@Ritesh_Burman

Once you read and create a Datatable variable then you can use as below

DataTable.Columns.IndexOf(“ColumnName ”).ToString

Hope this may help you

Thanks,
Srini