- ©«¤l
- 192
- ¥DÃD
- 15
- ºëµØ
- 0
- ¿n¤À
- 194
- ÂI¦W
- 0
- §@·~¨t²Î
- windows
- ³nÅ骩¥»
- office2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¤k
- µù¥U®É¶¡
- 2016-9-22
- ³Ì«áµn¿ý
- 2020-8-28
|
¥»©«³Ì«á¥Ñ starbox520 ©ó 2016-10-26 20:51 ½s¿è
¦^´_ 45# GBKEE - Option Explicit
- Private Sub UserForm_Initialize()
- StartupPosition = 0
- Top = 0
- Left = Windows(1).Width - Width
- lstSelector_³]©w
- End Sub
- Private Sub lstSelector_³]©w()
- With lstSelector
- '**¤Ï¦Êªº³¡¤À¥i¥H¥u¯à¤Ï¥Õ¤@µ§ ¡A¤£n³o»ò¦hµ§¶Ü
- ' **¨ú®ø .MultiSelect = 1 *** MultiSelect ÄÝ©Ê «ü©wª«¥ó¬O§_±µ¨ü¦h«¿ï¨ú¡C
- If Not IsEmpty(Sheets("TR±Æ¾÷&²£¥X").Sh_Ar) Then .List = Sheets("TR±Æ¾÷&²£¥X").Sh_Ar
- End With
- With ListBox1 '**frmSelector¤¤ªº²Ä¤GÓListBox ±±¨î¶µ
- .ColumnCount = 9
- .ColumnWidths = "60,35,75,40,30,60,30,70,30"
- End With
- End Sub
- Private Sub lstSelector_Change()
- If lstSelector.ListIndex > -1 Then Ex_WIP
- End Sub
- Private Sub Ex_WIP()
- Dim i As Integer, Ar, A(1 To 4), Ab(), ii As Integer
- With Me.lstSelector
- For i = 0 To 3
- A(i + 1) = .List(.ListIndex, i)
- Next
- End With
- i = 2
- With Sheets("WIP")
- Do While .Cells(i, 1) <> ""
- If .Cells(i, "A") = A(1) And .Cells(i, "E") = A(2) And .Cells(i, "G") = A(3) And .Cells(i, "F") = A(4) Then
- If IsEmpty(Ar) Then ReDim Ar(1 To 1) Else ReDim Preserve Ar(1 To UBound(Ar) + 1)
- ReDim Ab(1 To 1, 1 To 9)
- For ii = 1 To 8
- Ab(1, ii) = .Cells(i, ii + 1) ' 8Äæ¸ê®Æ: BÄæ- IÄæ
- Next
- Ab(1, 9) = .Cells(i, "K") 'KÄæ
- Ar(UBound(Ar)) = Ab
- '** Listbox ³Ì¦hÅã¥Ü 9¦C
- End If
- i = i + 1
- Loop
- End With
- With ListBox1
- .Clear
- If UBound(Ar) > 1 Then
- .List = Application.Transpose(Application.Transpose(Ar))
- ElseIf UBound(Ar) = 1 Then
- .List = Ar(1)
- End If
- End With
- '***********************************
- End Sub
- Private Sub CommandButton1_Click()
- Dim AA, i As Integer, ii As Integer
- With lstSelector
- For i = 0 To .ListCount - 1
- If .Selected(i) Then
- If IsEmpty(AA) Then ReDim AA(1 To 4, 1 To 1) Else ReDim Preserve AA(1 To 4, 1 To UBound(AA, 2) + 1)
- For ii = 1 To 4
- AA(ii, UBound(AA, 2)) = .List(i, ii - 1)
- Next
- End If
- Next
- End With
- If IsEmpty(AA) Then
- MsgBox "§A¨S¦³¿ï¨ú¸ê®Æ"
- ElseIf UBound(AA, 2) > 4 Then
- MsgBox "§A¿ï¨ú ¶W¹L 4 µ§ ¸ê®Æ"
- Else
- If MsgBox("¦@ ¿ï¨ú " & UBound(AA, 2) & " µ§¸ê®Æ" & vbLf & "½T©w¿é¤J", vbYesNo) = vbYes Then
- With Sheets("TR±Æ¾÷&²£¥X").Sh_Rng.Offset(1)
- .Resize(4, 4) = ""
- .Resize(UBound(AA, 2), UBound(AA)) = Application.Transpose(AA)
- End With
- End If
- End If
- End Sub
½Æ»s¥N½X þ¸Ì¿ù¤F©O= =¥L¤@ª½»¡«¬ºA¤£²Å... §Ú¬O2010ªºÀ³¸Ó¸ò2003¬Û³q§r....
¤@ª½Åã¥ÜArªº°Ñ¼Æ«¬ºA¦³°ÝÃD
²Ä¤@ÓListBoxÀ³¸Ó¬O¦C¥X¬Ûªñªº«á¡A³Ñ¾lªº¸ê®Æ¦A¥H¤u§@ªí2"¼Æ¶q"¤j¤pÅã¥Ü
³oÓ¥i¥H¦C¤J¶Ü
|
|