Is it what you need ??
Option Explicit
Sub Treat()
Dim WkDic As Object
Set WkDic = CreateObject("Scripting.Dictionary")
Const WsRefN = "Data Keywords"
Const WsRpN = "Report"
Dim WsRef As Worksheet, WsRp As Worksheet
Dim Rg As Range
Dim K
Dim IsWs As Boolean
Set WsRef = Sheets(WsRefN)
Set WsRp = Sheets(WsRpN)
With WsRef
For Each Rg In Range(.Cells(2, "A"), .Cells(Rows.Count, "A").End(3))
WkDic.Item(Rg.Value) = Empty
Next Rg
End With
With WsRp
For Each K In WkDic
IsWs = Evaluate("isref('" & K & "'!A1)")
If (IsWs) Then
Sheets(K).Cells.Delete
.AutoFilterMode = False
With .Cells(1, 1).CurrentRegion
.AutoFilter Field:=3, Criteria1:="*" & K & "*"
.Cells.Copy Sheets(K).Cells(1, 1)
End With
Else
MsgBox ("Sheet " & vbCrLf & K & vbCrLf & "do not exist")
End If
Next K
.AutoFilterMode = False
End With
MsgBox (" Job Done ")
End Sub
Bookmarks