excel20142014
New Member
- Joined
- Oct 13, 2014
- Messages
- 1
I have a workbook with a different sheets. The macro should delete the sheets if B3 is not equal to B4 on them. B3 and B4 are both numbers.
This is what I have written:
Sub SD()
For Each Sheet In Application.Worksheets
If Range("B3").Value <> Range("B4").Value
Sheet.Delete
End If
Next Sheet
End Sub
But it is not working. I would appreciate it if you could let me know how to fix it.
This is what I have written:
Sub SD()
For Each Sheet In Application.Worksheets
If Range("B3").Value <> Range("B4").Value
Sheet.Delete
End If
Next Sheet
End Sub
But it is not working. I would appreciate it if you could let me know how to fix it.