HI.
I am struggling to work out how to do the above.
Basically, if a cell in column G (Service downtime) in the attached, contains a 0, I need to change the text to read N/A. And if it contains a 1, I need to change it to a 1.
The amount of rows that this occurs in is dynamic also.
Could someone who is more proficient, provide me with an example please?
Use Excel Application Scope
In that Give path of the file
Then in that use Read Range ------Give Sheet name and Set output as DT
Then use For Each Row -----Give input as DT
Then in Fir Each Row use If Condition say
If row(“Service downtime”).ToString.Trim=“0” -----Here u can use Contains Condition instead of “=”
Then Assign
row(“Service downtime”)=“N/A”
Else Again Use IF condition
IF row(“Service downtime”).ToString.Trim.Contains(“1”)
Then Assign
row(“Service downtime”)=“1”
I have share both condition for understanding
After that use Write Range outside the For Each Row
In that give Sheet name and Datatable as DT
row(“Service downtime”)
Thanks for this.
I assume I must be doing something incorrectly as I am getting an error in ‘For Each Row’ on the output which is ‘Value of type ‘System.Data.DataTable’ cannot be converted to Integer’
Any suggestions where I am going wrong?