How could we modify macro Script to have different columns as No Format Data Type
In an Excel CSV File
Sub macro()
Range(“D:D”).Select 'specify the range which suits your purpose
With Selection
Selection.NumberFormat = “General”
.Value = .Value
End With
End Sub
Example
1)Column A Data Type as Number Format
2)Column C as Number Format
3)Column K as Number Format
@NISHITHA
you can achieve this by using the “Invoke VBA” activity to execute the provided VBA script in Excel. Here’s an example of how you can modify the VBA script to handle different columns:
vbaCopy code
Sub ModifyColumnFormats()
' Column A
Columns("A:A").Select
With Selection
.NumberFormat = "General"
.Value = .Value
End With
' Column C
Columns("C:C").Select
With Selection
.NumberFormat = "General"
.Value = .Value
End With
' Column K
Columns("K:K").Select
With Selection
.NumberFormat = "General"
.Value = .Value
End With
End Sub
Now, to use this VBA script in UiPath, you can follow these steps:
Use the “Invoke VBA” activity in your UiPath workflow.
In the properties of the “Invoke VBA” activity, set the VbaProjectFile property to the path of your Excel file (if your macro is stored in the Excel workbook).
Set the EntryPoint property to the name of the macro, in this case, “ModifyColumnFormats”.