¬O§_¥i¨ó§UקïVBA µ{¦¡(¸õ¹LM2 & WÄæ¦ì)
µ{¦¡°õ¦æ»¡©ú:
·í«ö¤UOutput "Find" °õ¦æ®×Áä,¸õ¹LM2 & WÄæ¦ì- Private Sub Sel(xstr)
- Dim i, j, jj, k, x, lotno
- Dim ToRange As Range
- Dim tmpArr(), n(), Arr
- With Worksheets(1)
- Arr = .Range("a1:bl" & .[A65536].End(3).Row)
- End With
- With ActiveSheet
- Set ToRange = .Range("F3:J23")
- ReDim tmpArr(1 To ToRange.Rows.Count, 1 To 5)
- ReDim n(1 To ToRange.Rows.Count)
- ToRange.ClearContents: .[G1] = ""
- xrr = Split(xstr, ",")
- For i = 6 To UBound(Arr)
- lotno = Arr(i, 1)
- part1 = Left(lotno, 13)
- For Each x In xrr
- If lotno = x Then
- .Range("G1") = lotno
- For j = 5 To 61 Step 3
- k = (j - 2) / 3
- For jj = 0 To 2
- If j + jj <= 61 Then
- If Trim(Arr(i, j + jj)) <> "" Then
- n(k) = n(k) + 1
- If n(k) <= 5 Then tmpArr(k, n(k)) = Arr(i, j + jj)
- End If
- End If
- Next jj
- Next j
- End If
- part2 = Left(x, 13)
- If part1 = part2 Then If InStr(l2, Arr(i, 64)) = 0 Then l2 = l2 & "," & Arr(i, 64)
- Next
- Next i
- ToRange = tmpArr
- .[l2] = Mid(l2, 2)
- End With
- End Sub
½Æ»s¥N½X
|