Excel fill empty cells

Hie there i have a excel sheet where there are some cells which are empty i check those cells and if the cells is empty i put one custom sentence “test” onto that all empty cells how could i do that

using a macro for excel.

inside a excel scope put invoke vba activity
and the macro has this code

Sub fillWhiteCells(sheetName)

	Range("A1:Z" & Range("A" & Rows.Count).End(xlUp).Row).Select
	Dim celda As Range
	For Each celda In Selection
		If celda.Value = "" Then
                    celda.Value = "test"
		End If
	Next celda

end sub

Hi @singh_sumit

Let’s say if your data table has 3 columns, you can execute a query something like this:

dt.AsEnumerable.ToList.ForEach(Sub(row)
row("Column1") = if(row("Column1").ToString.Equals(String.Empty),"Custom Text",row("Column1").ToString)
row("Column2") = if(row("Column2").ToString.Equals(String.Empty),"Custom Text",row("Column2").ToString)
row("Column2") = if(row("Column2").ToString.Equals(String.Empty),"Custom Text",row("Column2").ToString)
End Sub)

Please take the fact that this query is for those datatable where you are sure about the number of columns prior, and they might not change in the future.

Hope this helps,
Best Regards.