Sub 提取村委会()
Dim arr1
Dim k As String
Dim row2 As String
Dim colu2 As String
arr1 = Array("前锋", "西海", "八家", "冲洋", "新围", "竹洛", "竹湖", "新屋", "达材", "朝中", "官窦", "伞塘", "白岗", "稔坪", "西坑", "三和", "居委", "冲蒌圩")
Set rng1 = Application.InputBox(prompt:="选择数据源的一列区域", Type:=8)
rng1.Select
Set rng2 = Application.InputBox(prompt:="选择保存结果一个单元格", Type:=8)
row2 = rng2.Row
colu2 = rng2.Column
For Each i In rng1
For j = LBound(arr1) To UBound(arr1)
k = arr1(j)
If InStr(i, k) Then
Debug.Print (k)
'Target = k
'MsgBox ("选择存放单元格位置")
Cells(row2, colu2).Value = k
End If
Next
row2 = row2 + 1
Debug.Print
Next
End Sub
Sub 提取村委会() Dim arr1 Dim k As String Dim row2 As String Dim colu2 As String arr1 = Array("前锋", "西海", "八家", "冲洋", "新围", "竹洛", "竹湖", "新屋", "达材", "朝中", "官窦", "伞塘", "白岗", "稔坪", "西坑", "三和", "居委", "冲蒌圩") Set rng1 = Application.InputBox(p