Does anyone has experience to automate cell formatting in Excel?
For example you want to change a decimal 1.25 to 1.3.
In Excel we manually do this through Format Cell panel:
*Write cell with round up function is also not the solution that we’re looking for.
use the invoke VBA activity inside of excel scope activity
save the below code in a text file save it as .txt file
Sub reformat_cells(in_range As String)
Range(in_range).Select
Selection.NumberFormat = "_($* #,##0.00_);_($* (#,##0.00);_($* ""-""??_);_(@_)"
End Sub
Invoke VBA activity parameters
Code File Path => the text file with the VBA Code EntryMethodNme => the method or Sub name in the txt file => "reformat_cells" EntryMethodParameters => this is the range you want to change the cell format to. Just change it in the assign activity
examples: “A1” or “G6:L11”
Please see example below, down load it and run it for yourself and let me know if it helps.
I tried to use the VBA code and change code for format of cells. It’s get error of “mismatch type”. I use for decimal format (ex. 4.8). I changed the code to: