Want to remove space in every cell in the Excel

@ragul.n

Follow the steps…

Read the data into datatable…

  1. Use for loop onthe datatable(currentrow)
  2. Inside the loop …use another loop(item) for columns on Enumerable.Range(0,dt.Columns.count).ToArray and change type argument to int32
  3. Inside the second loop use assign
    Currentrow(item) = currentrow(item).ToString.Trim
  4. Writw the data back to excel

Cheers

1 Like