Function Get_Layer(xStr$) As String
Dim i%, j&, N%, U, T, TT$, Ta$, Tb$
T = xStr
For Each U In Array("02G", "04G", "08G"): T = Replace(T, U, Mid(U, 2)): Next
T = Split(T, "-")
For j = UBound(T) To 0 Step -1
N = 0: Ta = "": Tb = ""
For i = 7 To 1 Step -1
TT = "-" & T(j)
If N <> 5 Then
N = InStr(TT, 2 ^ i & "G")
If N > 0 Then If Not IsNumeric(Mid(TT, N - 1, 1)) Then Ta = 2 ^ i & "G": Exit For
End If
Next i
If Ta = "" Then GoTo 101
N = N + Len(Ta)
For i = N To N + 2
Tb = Mid(TT, i, 1)
If Val(Mid(TT, i, 1)) Then Tb = Left(Val(Mid(TT, i)), 2): Exit For
Tb = ""
Next i
If Tb <> "" Then Get_Layer = Ta & "*" & Tb: Exit Function
101: Next j
End Function作者: v03586 時間: 2015-11-30 01:05
Sorry sir ....知道修改哪裡了!!作者: 准提部林 時間: 2015-11-30 10:07
本帖最後由 准提部林 於 2015-11-30 10:27 編輯
報表〔CUSTNAME〕符合〔指定關鍵字〕,不加總該筆數量∼∼
If InStr(RepArr(j, 2), "ENG") Or InStr(RepArr(j, 2), "CSP") Then GoTo 101 改成如下:
Dim x, XX
XX = Array("HQ-5F", "HQ5F", "HQ-2F", "HQ2F", "AT7F", "AT6F", "CSP", "ENG")
For x = 0 To UBound(XX)
If InStr(RepArr(j, 2), XX(x)) Then GoTo 101
Next作者: v03586 時間: 2015-11-30 21:15