excelnewbie1986
New Member
- Joined
- May 16, 2018
- Messages
- 16
Hi all,
Hoping someone can help! When running the macro below, I am getting a run-time error 1004 - No cells were found error. I have tried diagnosing this issue myself, but am at a loss. This macro worked perfectly on the worksheet it was originally created on. So I used that worksheet as a template, and I then paste a tonne of raw data into the template to run the macro to remove certain things, but now when I run the macro in subsequent copied versions of the template, it no longer works. The blue text denotes where the debugger has picked up the error.
Application.ScreenUpdating = False
With Range("Z:Z")
.Replace "G", "=GGG", xlWhole, , False, , False, False
.SpecialCells(xlFormulas, xlErrors).EntireRow.Delete
End With
Application.ScreenUpdating = False
With Range("V:V")
.Replace "WATERS EDGE PRIMARY SCHOOL", "=GGG", xlWhole, , False, , False, False
.SpecialCells(xlFormulas, xlErrors).EntireRow.Delete
End With
Application.ScreenUpdating = False
With Range("V:V")
.Replace "Green Abbeys", "=GGG", xlWhole, , False, , False, False
.SpecialCells(xlFormulas, xlErrors).EntireRow.Delete
End With
With Range("W:W")
.Replace "331", "=GGG", xlWhole, , False, , False, False
.SpecialCells(xlFormulas, xlErrors).EntireRow.Delete
End With
With Range("W:W")
.Replace "860", "=GGG", xlWhole, , False, , False, False
.SpecialCells(xlFormulas, xlErrors).EntireRow.Delete
End With
With Range("W:W")
.Replace "", "=GGG", xlWhole, , False, , False, False
.SpecialCells(xlFormulas, xlErrors).EntireRow.Delete
End With
With Range("Y:Y")
.Replace "", "=GGG", xlWhole, , False, , False, False
.SpecialCells(xlFormulas, xlErrors).EntireRow.Delete
End With
Thanks in advance!!
Hoping someone can help! When running the macro below, I am getting a run-time error 1004 - No cells were found error. I have tried diagnosing this issue myself, but am at a loss. This macro worked perfectly on the worksheet it was originally created on. So I used that worksheet as a template, and I then paste a tonne of raw data into the template to run the macro to remove certain things, but now when I run the macro in subsequent copied versions of the template, it no longer works. The blue text denotes where the debugger has picked up the error.
Application.ScreenUpdating = False
With Range("Z:Z")
.Replace "G", "=GGG", xlWhole, , False, , False, False
.SpecialCells(xlFormulas, xlErrors).EntireRow.Delete
End With
Application.ScreenUpdating = False
With Range("V:V")
.Replace "WATERS EDGE PRIMARY SCHOOL", "=GGG", xlWhole, , False, , False, False
.SpecialCells(xlFormulas, xlErrors).EntireRow.Delete
End With
Application.ScreenUpdating = False
With Range("V:V")
.Replace "Green Abbeys", "=GGG", xlWhole, , False, , False, False
.SpecialCells(xlFormulas, xlErrors).EntireRow.Delete
End With
With Range("W:W")
.Replace "331", "=GGG", xlWhole, , False, , False, False
.SpecialCells(xlFormulas, xlErrors).EntireRow.Delete
End With
With Range("W:W")
.Replace "860", "=GGG", xlWhole, , False, , False, False
.SpecialCells(xlFormulas, xlErrors).EntireRow.Delete
End With
With Range("W:W")
.Replace "", "=GGG", xlWhole, , False, , False, False
.SpecialCells(xlFormulas, xlErrors).EntireRow.Delete
End With
With Range("Y:Y")
.Replace "", "=GGG", xlWhole, , False, , False, False
.SpecialCells(xlFormulas, xlErrors).EntireRow.Delete
End With
Thanks in advance!!