Find and Replace in Excel

Hi @aspin13,

Here is an activity called “Find Replace” in the below package. It may be useful solve the issue.

Regards
Balamurugan.S

Hii Priyanka,

If your problem resolved, can you share your xaml file.

1 Like

@nimin

Hi Nimin,
Thank you for sharing this VBA file. I wanted to know is it possible to then count and display how many times the VBA replaced the value?

Hie Sahil
i have a data in excel in which particular values have value x i want to replace all those with 1 and null or blank value with 0 using uipath can you please help

1 Like

Hie Thasnia_Rob
i have a data in excel in which particular values have value x i want to replace all those with 1 and null or blank value with 0 using uipath can you please help

1 Like

Hello , I really hope I get your reply on this. I just used your find and replace method using VB code and it worked . but then I am only trying to do this find and replace in a particular column in one sheet. I.e in column J find ''yes ‘’ and replace with ‘‘No’’ of sheet1. Please help .thanks a lot

Hi Use the following vb.Net code in an invoke code activity

Dim xlApp As Microsoft.Office.Interop.Excel.Application
Dim wb As Microsoft.Office.Interop.Excel.Workbook
xlApp = New Microsoft.Office.Interop.Excel.Application
wb = xlApp.Workbooks.Open(Path)
TryCast(wb.sheets(SheetName),Microsoft.Office.Interop.Excel.Worksheet).Range(“A1:X3000”).Replace(Value1,Value2)
xlApp.DisplayAlerts = True
wb.Save()
wb.Close()

Arguments
Path = is the file path to the excel sheet
SheetName = The sheet name
Value 1 = lookup value
Value2 = replace value1 with this value