¥»©«³Ì«á¥Ñ starry1314 ©ó 2015-6-30 14:43 ½s¿è
¥\¯à:¥HC2Àx¦s®æªº³æ¤@±ø¥ó§@¬°§PÂ_
§Æ±æ:C2¦h±ø¥ó§PÂ_ ¥H¡i,¡j C2=¬õ,¿} §Y¶Ç¦^³Ì«á¤@¶µ¦³¦¹±ø¥óªº¤U¤@¹Dµæ
©Î¬O¦³¤j¤j¥i¥HÀ°µù©ú¥H¤Uµ{¦¡½Xªº¸Ñ»¡,¦nÅý¦Û¦æ§ï¶i¶Ü?\
¥X²{«ü©w¸T§Ò,¸õ©¹³Ì«á¤@¶µ¸T§Ò ©¹¤U¤@¹Dµæ.rar (18.15 KB)
- Sub Á׶}¸T§Ò()
- Dim arr, str, i&, k&, n&, brr
- On Error Resume Next
- str = [c2].Value
- arr = Sheets("data").[a1].CurrentRegion
- ReDim brr(1 To UBound(arr) + 1, 1 To 2)
- For i = 1 To UBound(arr)
- For j = 1 To UBound(arr, 2) Step 2
- If InStr(arr(i, j + 1), str) Then
- k = k + 1
- n = k + 1
- brr(k, 1) = arr(i, j)
- brr(k, 2) = arr(i, j + 1)
- brr(n, 1) = arr(i, j + 2)
- brr(n, 2) = arr(i, j + 3)
- End If
- Next
- Next
- 'If Err <> 0 Then MsgBox "¬d¤£¨ìµ²ªG": Exit Sub
- [c6] = brr(n, 1)
- MsgBox "³Ì«á¦³" & str & "¬°¡G" & brr(k, 1) & vbCr & "¥¦ªº¤U¤@Ó¬O¡G" & brr(n, 1)
- End Sub
½Æ»s¥N½X |