¥»©«³Ì«á¥Ñ yen956 ©ó 2015-12-6 13:16 ½s¿è
¤U¦CVBA¤¤,¦³¤@¬qmatch¶·¤Þ¥Î1ºû°}¦C,
¬G¥ý±N2ºû°}¦C¥ýÂন1ºû°}¦C¦A¤Þ¥Î(¬õ¦â³¡¤À),
½Ð°Ý¬õ¦â³¡¤À¦p¦ó¥¿½T¤Þ¥Î(¦p¦óºë²)?- Public arW, arL
- '¨ú±o寛«×»Pªø«×¬Éªº°}¦C, ¨ÑMatch¥Î
- Sub init()
- ReDim arW(3) As Integer
- ReDim arL(3, 3) As Integer
- Dim W1 As Integer, L1 As Integer
- arW(0) = Split(Cells(3, 3), "~")(1) '寛«×ªº¤W
- For W1 = 0 To 2
- arW(W1 + 1) = Split(Cells(W1 * 3 + 3, 3), "~")(0) '寛«×«ö°¾±Æ
- For L1 = 0 To 2
- arL(W1, L1) = Split(Cells(W1 * 3 + L1 + 3, 5), "~")(0) 'ªø«×«ö¤É¾±Æ
- Next
- arL(W1, L1) = Split(Cells(W1 * 3 + L1 + 2, 5), "~")(1) 'ªø«×ªº¤W
- Next
- End Sub
- Private Sub CommandButton1_Click()
- Dim I As Integer, J As Integer, arL2(3) As Integer
- Dim MHW, MHL, IDW As String, IDL As String
- init
- For I = 4 To [G4].End(xlDown).Row
- MHW = Application.Match(Cells(I, 8), arW, -1)
- IDW = Application.Index([B1:B11], MHW * 3, 1)
- [color=Red] For J = 0 To 3
- arL2(J) = arL(MHW - 1, J) '±N2ºû°}¦CÂର1ºû°}¦C
- Next
- MHL = Application.Match(Cells(I, 9), arL2, 1)[/color]
- 'ªø«×¥N¸¹¤À[D3:D5,D6:D9,D10:D12]¤T°Ï
- IDL = Application.Index([D3:D5,D6:D8,D9:D11], MHL, 1, MHW)
- Cells(I, 10) = IDW & "_" & IDL
- Next
- End Sub
½Æ»s¥N½X (µù:VBA¥i¥¿±`¹B§@)
For J = 0 To 3
arL2(J) = arL(MHW - 1, J) '±N2ºû°}¦CÂର1ºû°}¦C
Next
MHL = Application.Match(Cells(I, 9), arL2, 1)
¦h±ø¥ó§PÂ_½s»s¦WºÙ1206.rar (11.7 KB)
|