Created
July 22, 2017 17:40
-
-
Save ndthanh/ab26003ee9e4d08f8cc175a1646de339 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub DeleteRows() | |
'Updateby20140314 | |
Dim rng As Range | |
Dim InputRng As Range | |
Dim DeleteRng As Range | |
Dim DeleteStr As String | |
xTitleId = "Hoc Excel Online" | |
Set InputRng = Application.Selection | |
Set InputRng = Application.InputBox("Range :", xTitleId, InputRng.Address, Type:=8) | |
DeleteStr = Application.InputBox("Delete Text", xTitleId, Type:=2) | |
For Each rng In InputRng | |
If rng.Value = DeleteStr Then | |
If DeleteRng Is Nothing Then | |
Set DeleteRng = rng | |
Else | |
Set DeleteRng = Application.Union(DeleteRng, rng) | |
End If | |
End If | |
Next | |
DeleteRng.EntireRow.Delete | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment