這是一個簡單的解決方案,它使用數組而不是範圍。只需根據需要插入國家名稱到陣列:
Sub deletingcountries()
Dim sht As Worksheet
Dim i As Long
Dim lastrow As Integer
Set sht = ActiveWorkbook.Worksheets("Sheet1")
lastrow = sht.Cells(sht.Rows.Count, "D").End(xlUp).Row
Dim countries As Variant, country As Variant
countries = Array("Country1", "Country2", "Country3", "Country4", "Country5") 'add however many countries necessary
For i = 1 To lastrow
For Each country In countries
If InStr(ActiveWorkbook.Worksheets("Sheet1").Range("D" & i).Value, country) Then
ActiveWorkbook.Worksheets("Sheet1").Range("D" & i).Value = "deletME"
End If
Next country
Next i
End Sub
[This](http://www.siddharthrout.com/2011/07/14/find-and-findnext-in-excel-vba/ )會讓你開始 –