I am trying to perform calculations in master sheet in some coloumn which is the percentage. After that, I am filtering some values according to some conditions and writing those rows in another excel.
Now in another excel, that percentage coloumn is not percentage anymore, it is changing to general. Example: 100.00% is changing to 1.
How to do this automatically.
If not how to change it later after another sheet is created.
I have tried it the following code after creating a sheet in invoke code and invoke vba activity but it is not working.
Sub ChangeFormat()
Range(“R1:R20”).NumberFormat=“0.00%”
End Sub
Also, I want it for full coloumn, not for any specific range
we can reformat with the help of Balreva Excel Activities package and activity Change Cell type
When working within Modern Design (Activities) we can use:
we could use e.g. A:A as range for entire a column. For some reasons we would recommend to use the row count and calculate the range for the used data block
Is the format of that column preserved when you view the DataTable in the immediate panel?
Does the column value contain 100% or is it in the form you have shared with us when its in the bot memory?
After reading the sheet, could you try querying the DataTable in the Immediate Panel and check if the percentages are present?
If so, then formats is maintained when the bot reads it, then you can simply use a For Each Row in DataTable Activity and assign this to the CurrentRow →
The single quote forces excel to interpret the values as text, hence retaining the percentages.
If that is unsuccessful, then we would appreciate it if you could share the sample data with us so that we can test out few other scenarios from our end.