- ©«¤l
- 522
- ¥DÃD
- 36
- ºëµØ
- 1
- ¿n¤À
- 603
- ÂI¦W
- 0
- §@·~¨t²Î
- win xp sp3
- ³nÅ骩¥»
- Office 2003
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-12-13
- ³Ì«áµn¿ý
- 2021-7-11
|
¥i¥H¥ÎVBA¶Ü?
¸Õ¸Õ¬Ý:- 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)
- For J = 0 To 3
- arL2(J) = arL(MHW - 1, J) '±N2ºû°}¦CÂର1ºû°}¦C
- Next
- MHL = Application.Match(Cells(I, 9), arL2, 1)
- 'ªø«×¥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
|
|