Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub UnSelectCell()
- 'Updateby20140314
- Dim rng As Range
- Dim InputRng As Range
- Dim DeleteRng As Range
- Dim OutRng As Range
- xTitleId = "Hoc Excel Online"
- Set InputRng = Application.Selection
- Set InputRng = Application.InputBox("Range :", xTitleId, InputRng.Address, Type:=8)
- Set DeleteRng = Application.InputBox("Delete Range", xTitleId, Type:=8)
- For Each rng In InputRng
- If Application.Intersect(rng, DeleteRng) Is Nothing Then
- If OutRng Is Nothing Then
- Set OutRng = rng
- Else
- Set OutRng = Application.Union(OutRng, rng)
- End If
- End If
- Next
- OutRng.Select
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement