detriez
Board Regular
- Joined
- Sep 13, 2011
- Messages
- 193
- Office Version
- 365
- Platform
- Windows
@DonkeyOte posted this great code HERE for deleting records with a hotmail.com domain
I have a named range [nEmailDomains] on the fle with a number of domains
I need to do the exact same except I need to reference nEmailDomains and delete every entry with a domain on the list rather than just hotmail.com
I have a named range [nEmailDomains] on the fle with a number of domains
I need to do the exact same except I need to reference nEmailDomains and delete every entry with a domain on the list rather than just hotmail.com
VBA Code:
Dim rng As Range
Columns(3).AutoFilter Field:=1, Criteria1:="=*@hotmail.com"
With ActiveSheet.AutoFilter.Range
Set rng = .Offset(1, 0).SpecialCells(xlCellTypeVisible)
Application.DisplayAlerts = False
If Not rng Is Nothing Then rng.Delete
Application.DisplayAlerts = True
End With
Columns(3).AutoFilter