Replace empty column in excel

Hello guys, do u know how to replace empty column in excel? i use read range activity
the empty column here is unit

thanks

@Aluneth_X
What exactly u mean by replace? Replace with what?

The output “Column1” there i want to replace with string like " " or “No Unit”

Hi @Aluneth_X

There are two ways to do that.

  1. Using excel itself

  2. Using a data table

  3. In excel

Within a loop, do a read cell activity to check whether there is any data in that particular cell. If not, use a write cell to replace it with the value you need.

  1. Datatable
    Use a read range to read the data to a datatable. Then within a for each row loop, do the same condition ad above. Use a if condition to test whether you have a value in the column rows. If not replace it with the value you need. Then do a write range to write back the data to excel.

Checking whether it has a value, you can use this code

If activity
Not String.IsNullOrEmpty(Row("ColumnName").ToString)

Assigning a value
Row(“ColumnName”) = “your value”

1 Like

Good morning Aluneth,

If you’re trying to update the entire column at once, you can accomplish this using Expressions (similar to Excel formulas).

Check out this link for an example: Updating all rows of a column together