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?
IN PROGRESS - Test.xlsx (9.3 KB)
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 “=”
Else Again Use IF condition
IF row(“Service downtime”).ToString.Trim.Contains(“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
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?
Hey you are converting Datatable to integer can you show me what you did in assign
I’m not trying to convert it no.
It will either read 0 or 1 when the sheet is opened and I need to change 0 to N/A and 1 to YES.
I am probably doing something completely wrong. I have attached the screenshot
It’s in the ‘output’ on the For Each Row bit
can you share me workflow
You are getting error coz you give index as Datatable output
remove this you dont need this
Awesome. I knew I had done something wrong. That works a treat now. Thank you so much
Please mark it as solution and close this topic
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.