код выполняется, но не находит / не заменяет значения.
Я считаю, что проблемы в цикле for с таблицами и методом замены
Sub UGA()
'PURPOSE: Loop through all Excel files in a user specified folder and perform a set task on them
Dim wb As Workbook
Dim ws As Worksheet
Dim myPath, myFile, myExtension As String
Dim fnd, rep As Variant
Dim FldrPicker As FileDialog
'Loop through each Excel file in folder
Do While myFile <> ""
'Set variable equal to opened workbook
Set wb = Workbooks.Open(Filename:=myPath & myFile)
'Ensure Workbook has opened before moving on to next line of code
DoEvents
'find and replace with blank
fnd = "find this"
rep = ""
'Loop through each worksheet in ActiveWorkbook
For Each ws In ActiveWorkbook.Worksheets
ws.Cells.Replace What:=fnd, Replacement:=rep, _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, _
SearchFormat:=False, ReplaceFormat:=False
Next ws
'Save and Close Workbook
wb.Close SaveChanges:=True
'Ensure Workbook has closed before moving on to next line of code
DoEvents
'Get next file name
myFile = Dir
Loop
'Message Box when tasks are completed
MsgBox "Complete!"
End Sub
ожидается найти определенное значение и заменить его пробелами ("")