Sort datatable data based on one column

Hi @clumsily

Another way to achieve the same.

dt.AsEnumerable.OrderBy(Function (r) r("Brand").ToString).CopyToDataTable.DefaultView.ToTable(False, {"Brand", "Name", "Price"})

Finally you can write dt in excel file using Write Range

3 Likes