• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Loop through list and only autofilter and change the status.

Why autofilter? You can use scripting dictionary like below. Using your example sheet.

Code:
Sub Test()
Dim dict As Object
Dim cel As Range

Set dict = CreateObject("Scripting.Dictionary")
dict.CompareMode = vbTextCompare

dict.Add Key:="INDIA", Item:="IN"
dict.Add Key:="USA", Item:="U"
dict.Add Key:="UK", Item:="K"

For Each cel In Range("A2:A" & Cells(Rows.Count, 1).End(xlUp).Row)
    If dict.exists(cel.Value) Then
        cel.Offset(, 1).Value = dict.Item(cel.Value)
    End If
Next cel

End Sub
 

Hi !

Even no need a code, just with a worksheet formula …
And by code, why an autofilter ?!
 
Back
Top