VBO code not working in excel

Hi Team,
I have created a vbo code that will convert all data in excel to lower case, remove “n/a” to " " in res2 and res3 column of excel…but it is not working…can anyone help ?

Sub RoundToZero1()
Dim lRow As Long
lRow = ThisWorkbook.ActiveSheet.UsedRange.Rows.Count
For Counter = 1 To lRow
Set Curcell = ThisWorkbook.ActiveSheet.Cells(Counter, 5)

If Curcell.Value = "N/A" Then
    Curcell.Value = ""
Else: Curcell.Value = LCase(Curcell.Value)
End If

Set Curcell = ThisWorkbook.ActiveSheet.Cells(Counter, 6)

If Curcell.Value = "N/A" Then
    Curcell.Value = ""
Else: Curcell.Value = LCase(Curcell.Value)
End If

Set Curcell = ThisWorkbook.ActiveSheet.Cells(Counter, 7)

If Curcell.Value = "N/A" Then
    Curcell.Value = ""
Else: Curcell.Value = LCase(Curcell.Value)
End If

Next Counter
End Sub

ARM_input.xlsx (10.5 KB)
Please find attached excel.

Pls check attached file for example VBA code.
ARM_input.zip (17.1 KB)

I’m a new user here. I’m also interested to know more about it.Thank you so much.

i want to do it via uipath…using invoke vba code…can u pls let me know how it can be done?

Pls check.Invoke.zip (40.0 KB)

@som17 Are you getting any error or just get to know how it can be integrated with UiPath?

@som17 If you were able to get the output for the above VBA code which you have given, but it was only Converting some values but you want to convert all values in the Excel to lowercase then you can try this code I have provided below.
VBA Code.txt (469 Bytes)

want to know how it can be integrated with UiPath…I have uploaded the excel sheet in which i require the output of the vbo code.

thanks superman…but if u see my above VBO code…it is converting “res2” and res3 coulmns to blank i.e. “” if there is “n/a” or “N/A”, “N\A” present in them.

@som17 So if there is a “n/a” or “N/A” as a value in the Cell then it should be made empty. If so, I think this updated code should give you the output.
VBA Code.txt (499 Bytes)

1 Like