Try this as well...
Sub test()
Dim str As String
Dim a As Integer, x As Integer
Dim arrylist(0 To 25) As Variant
Dim colrange As Range, i As Integer, spltcount As Integer
Dim flagv As Integer
i = 0
spltcount = 0
flagv = 0
Dim name As Variant, rng As Range
Range("N1").Select
x = ActiveCell.Column
str = ActiveCell.Value
name = Split(str, ",")
For a = 0 To UBound(name)
arrylist(a) = name(a)
x = x + 1
spltcount = spltcount + 1
Next a
Range("A1").Select
Set colrange = Range("HA1")
While ActiveCell.Value <> ""
For i = 0 To spltcount - 1
If Mid(ActiveCell.Address, 2, 1) = arrylist(i) Then
flagv = 1
End If
Next i
If flagv = 0 Then
Set colrange = Union(colrange, Range(Mid(ActiveCell.Address, 2, 1) & ":" & Mid(ActiveCell.Address, 2, 1)))
End If
flagv = 0
ActiveCell.Offset(0, 1).Select
Wend
colrange.EntireColumn.Delete
End Sub
Bookmarks