Sub OpenDel()
Dim wb As Workbook
Set wb = Workbooks.Open("[COLOR=#ff0000]C:\MrExcel\acd.xls[/COLOR]")
With wb.Sheets("Sheet1").Range("AA:AA")
.Replace "*ZR*", "=XXX", xlPart, , False, , False, False
.SpecialCells(xlFormulas, xlErrors).EntireRow.Delete
End With
wb.Close True
End Sub
How aboutCode:Sub OpenDel() Dim wb As Workbook Set wb = Workbooks.Open("[COLOR=#ff0000]C:\MrExcel\acd.xls[/COLOR]") With wb.Sheets("Sheet1").Range("AA:AA") .Replace "*ZR*", "=XXX", xlPart, , False, , False, False .SpecialCells(xlFormulas, xlErrors).EntireRow.Delete End With wb.Close True End Sub
Sub OpenDel()
Dim wb As Workbook
Set wb = Workbooks.Open("C:\MrExcel\acd.xls")
With wb.Sheets("Sheet1")
With .Range("AA1", .Range("AA" & Rows.Count).End(xlUp))
.Replace "*ZR*", "=XXX", xlPart, , False, , False, False
.SpecialCells(xlFormulas, xlErrors).EntireRow.Delete
End With
End With
wb.Close True
End Sub
Sub OpenDel()
Dim wb As Workbook
Set wb = Workbooks.Open("C:\MrExcel\acd.xls")
With wb.Sheets("Sheet1")
With .Range("AA1", .Range("AA" & Rows.Count).End(xlUp))
.Replace "*ZR*", "=XXX", xlPart, , False, , False, False
.SpecialCells(xlFormulas, xlErrors).Offset(-1).Value = "=XXX"
.SpecialCells(xlFormulas, xlErrors).EntireRow.Delete
End With
End With
wb.Close True
End Sub