Hello all,
I am trying to make a code to check for all my sheets in a workbook:
If the cell A1 have the word REV. then i want this first Row to be deleted..
The code goes throw all workbok, reading correctly this cell value but somehow is not deleting this specific cell.
Sub apagar_linhaREV()
Dim Cell As Range
Dim Rng As Range
Dim Source As Worksheet
Dim wb As Object
Dim ws As Worksheet
Set wb = ActiveWorkbook
For Each ws In Worksheets
With ws
Set Source = ws
Set Rng = Source.Range("A1")
For Each Cell In Rng
If Cell = "REV." Then
Cell.EntireRow.Delete
Rows.Cells.Delete
'MsgBox "Ola mundo"
End If
Next Cell
End With
Next ws
End Sub
Bookmarks