Option Explicit
Sub TEST_S()
Dim A$, N%, i&, j%, M$, xU As Range, T$, xR As Range
A = "/資料/單位/單 位/單 位/單 位/單 位/備註/備 註/幹事/技士/技佐/組員/課員/治療師/工作師/" & _
"營養師/助理/佐理/管理/事務/組長/主任/業務/行政/查詢/"
For i = 6 To [A5000].End(xlUp).Row
Set xR = Cells(i, 1): T = Trim(xR): If InStr("/職稱//", "/" & T & "/") Then GoTo i01
For j = 1 To Len(T)
M = Mid(T, 1, j): N = InStr(A, M)
If N = 0 Then GoTo i02
If Mid(A, N - 1, 1) = "/" And Mid(A, N + j, 1) = "/" Then GoTo i01
If j = Len(T) Then GoTo i02
Next
i01: If xU Is Nothing Then Set xU = xR Else Set xU = Union(xU, xR)
i02: Next
If Not xU Is Nothing Then xU.EntireRow.Select
End Sub作者: honching99 時間: 2024-1-5 09:56