Board logo

¼ÐÃD: VBA §ì¨úListBox¤¤ªº¤º®e [¥´¦L¥»­¶]

§@ªÌ: wang077    ®É¶¡: 2021-6-28 16:25     ¼ÐÃD: VBA §ì¨úListBox¤¤ªº¤º®e

¦bListBox¤¤§Ú¤w¸g·s¼W¦n´Xµ§item
²{¦b§Ú­n§âListBox¤ºªº¸ê®Æ·í°µ¿z¿ï±ø¥ó¡A¦Ó¥B¤@¦¸¿z¿ï¦hµ§
½Ð°Ý§Ú¸Ó«ç»ò¼g?
[attach]33469[/attach]
[attach]33470[/attach]
§@ªÌ: samwang    ®É¶¡: 2021-6-28 17:34

¦^´_ 1# wang077 [/b   

¤è«K´£¨Ñªþ¥ó¶Ü? ÁÂÁÂ
§@ªÌ: wang077    ®É¶¡: 2021-6-28 21:57

¦^´_ 2# samwang
[attach]33471[/attach]
Ãþ¦ü³o¼Ë
§@ªÌ: wang077    ®É¶¡: 2021-6-29 09:46

¦^´_ 2# samwang
[attach]33473[/attach]
[attach]33472[/attach]
¤j¯«¡A§Ú«á¨Ó§ï¥ÎCheckBoxµM«á©ñ¶i°j°é¡C
¦ý­n«ç»ò¿z¿ï¦hµ§CheckBox?
§@ªÌ: wang077    ®É¶¡: 2021-6-29 14:48

¦^´_ 2# samwang
¤j¯«¦³¸Ñ¶Ü?
§@ªÌ: samwang    ®É¶¡: 2021-6-29 15:02

¦^´_ 5# wang077


¤£¦n·N«ä¡A¨S¦³¸Ñªk¡A¬Ý¬Ý¨ä¥L¤j¤j¬O§_¦³¸Ñªk¡AÁÂÁÂ
§@ªÌ: samwang    ®É¶¡: 2021-6-29 15:45

¦^´_ 5# wang077


¥t¥~½Ð±Ð¤@¤U¡A¤£¤Ó¤F¸Ñ¬°¦ó¤£ª½±µexcel ¿z¿ï´N¦n?
§@ªÌ: wang077    ®É¶¡: 2021-6-29 16:14

¦^´_ 7# samwang
¥DºÞ­n¨D¡A¦Ó¥B¤£¥u³o­ÓÄæ¦ì­n¦hµ§¿z¿ï¡A¤j·§¦³10Ä楪¥k§a:L
§@ªÌ: samwang    ®É¶¡: 2021-6-29 16:43

¥»©«³Ì«á¥Ñ samwang ©ó 2021-6-29 16:46 ½s¿è

¦^´_ 8# wang077


¤£¤Ó¤F¸Ñ¹ê»Ú»Ý¨D¡A²z½×¤W¦bExcel¨Ì¾Ú±ø¥ó¿z¿ï«á¡A´N¥i¥HÂà¥Xµ²ªG¿z¿ï«áªº¸ê®Æ¡A¤£¤@©w­n¦bListBOX²M³æ¹B§@
À³¸Ó¦³¨ä¥L¤èªk¥i¥H¹F¨ì»Ý¨D¡A¦ýÁÙ¬O»Ý­n§A¦³´£¨Ñ¹ê»Úªº½d¥»»Ý¨D¡A ¤~¥i¥H°Q½×¥i¦æ©Ê¡AÁÂÁ¡C
§@ªÌ: wang077    ®É¶¡: 2021-7-1 09:43

¥»©«³Ì«á¥Ñ wang077 ©ó 2021-7-1 09:44 ½s¿è

¦^´_ 9# samwang
[attach]33477[/attach]
¹³¬O³o¼Ë¡A§Ú¥Ø«e³Ð¤F2­Ó¾÷¥x¡A¦pªG§Ú¦³¦n´X­Ó¾÷¥x
´N¥i¥Hª½±µ¥ÎListBox§Ö³t¥h¦h±ø¥ó¿z¿ï¡A
¦Ó¤£¥Î¥h¨C­Ó¾÷¥xªºSheet¸Ì¿z¿ï¬d¸ß
¦ý²{¦bªº°ÝÃD´N¬OListBox§Ú¥u¯à°µ¨ì¤@­Ó¿z¿ï
¦Ó½Æ¿ïListBox¨Ó¿z¿ï§Ú¤£ª¾¹D«ç»ò¸Ñ
§@ªÌ: samwang    ®É¶¡: 2021-7-1 12:30

¥»©«³Ì«á¥Ñ samwang ©ó 2021-7-1 12:32 ½s¿è

¦^´_ 10# wang077

¦]¬°ªí³æ¼gªk§ÚÀ´¤@ÂIÂI¦Ó¤w¡A¥i¥H¤£¥ÎlistBox§e²{¶Ü?
¤]´N¬O»¡¦bExcel¿é¤J§A·Q­nªº¬d¸ß¤°»ò¡AµM«á±Nµ²ªG¦bexcel¤W­±¡A³o¼Ë¥i¦æ¶Ü?
§@ªÌ: wang077    ®É¶¡: 2021-7-1 13:11

¦^´_ 11# samwang
¥i¥H¡A¦ý­«ÂI´N¬O¥i¥H¦h±ø¥ó¿z¿ï
§@ªÌ: samwang    ®É¶¡: 2021-7-1 13:40

¦^´_ 12# wang077


¨º¬O§_¥i¥H½Ð§AªþÀɤ@­Ó»Ý¨Dªº½d¨Ò¡AÁÂÁÂ
§@ªÌ: wang077    ®É¶¡: 2021-7-1 13:59

¦^´_ 13# samwang
[attach]33478[/attach]
¯à¥Î³o­Ó·í½d¨Ò¶Ü
¤½¥q¸ê®Æ¡A¤£¤è«K©ñ¤W¨Ó
§@ªÌ: samwang    ®É¶¡: 2021-7-1 14:22

¦^´_ 14# wang077


³o­Óªþ¥ó©M§A¤W¦¸ªºªþ¥ó¤@¼Ë¨S¦³½d¨Òµ²ªG¡A
½Ð¦A½T»{¡AÁÂÁÂ
§@ªÌ: wang077    ®É¶¡: 2021-7-1 14:49

¦^´_ 15# samwang
[attach]33479[/attach]
³o¼Ë©O?
§@ªÌ: samwang    ®É¶¡: 2021-7-1 15:44

¦^´_ 16# wang077

½Ð°Ý¤@¤U¡A±z¿z¿ï«áªº¼Æ¾Ú¤£´Nµ¥©óµ²ªG¶Ü? ¬°¦óÁÙ­n¦h¦¹¤@Á|±N¸ê®ÆÂಾ¨ìµ²ªGsheet¸Ì­±?

¦A¦¸½T»{±zªº»Ý¨D¡A­Ó¤H¿z¿ï«á«ö"°õ¦æ«ö¶s"±N¨º¨Ç¸ê®Æ¨ì½Æ»s"µ²ªG"ªºsheet ¶Ü?
§@ªÌ: wang077    ®É¶¡: 2021-7-1 15:51

¦^´_ 17# samwang
¦]¬°§Ú¤£¥u¨â­Ó¾÷¥x¡A¦pªG«Ü¦h¾÷¥xªº¸Ü§Ú´N»Ý­n¨ì¨C­Ósheet¿z¿ï
©Ò¥H¤~»Ý­n«ü©w¾÷¥x¡AµM«á±N¿z¿ïµ²ªG¶K¨ì(µ²ªG)ªºsheet
§@ªÌ: samwang    ®É¶¡: 2021-7-1 16:05

¦^´_ 18# wang077


©ÎªÌ§Ú¦³­Ó·Qªk¡A´N¬O±N©Ò¦³ªº¬¡­¶Ã¯ªº¸ê®Æ·J¾ã¨ìÁ`ªí¬¡­¶Ã¯¡A
Á`ªí·|¦³¤@¦C³Æµù­þ­Ó¾÷¥x(¨ú¦U­¶ªº¬¡­¶Ã¯¦WºÙ)¡A
µM«á¿z¿ï«á«ö¶s±N¸ê®ÆÂà¨ìµ²ªG¡A
¤£ª¾¹D³o¼Ë¥i¦æ¶Ü?©ÎªÌ§A¦³µL¨ä¥L·Qªk?
§@ªÌ: wang077    ®É¶¡: 2021-7-1 16:16

¦^´_ 19# samwang
¦n¹³¤]¥i¥H¡A³Â·Ð¤j¤j¤F
§@ªÌ: samwang    ®É¶¡: 2021-7-1 19:29

¦^´_ 20# wang077


½Ð´ú¸Õ¬Ý¬Ý¡AÁÂÁÂ
§@ªÌ: wang077    ®É¶¡: 2021-7-2 07:51

¦^´_ 21# samwang
¤j¤j¡A§ÚªºÅv­­¤£°÷¡A¨S¿ìªk载¤U¨Ó¡A¥i¥H¶Ç¨ì§Úªºmail¶Ü?
mail:[email protected]
§@ªÌ: samwang    ®É¶¡: 2021-7-2 10:20

¦^´_ 22# wang077


¤w±H¥X¡A½Ð½T»{¡AÁÂÁÂ
§@ªÌ: wang077    ®É¶¡: 2021-7-2 11:05

¦^´_ 23# samwang
¦¬¨ì¤F¡A·PÁÂÀ°¦£¡C
§@ªÌ: wang077    ®É¶¡: 2021-7-2 16:07

¦^´_ 9# samwang
¤j¤j¤£¦n·N«ä¡A¤p§Ì¦³¥t¤@­Ó°ÝÃD
[attach]33493[/attach]
¦p¦ó§â¾÷1»P¾÷2¨â­Óexcelªºsheet1¸ê®Æ¥ÎVBA·J¾ã¨ì·sªºexcel¸Ìªºsheet1
¤wªþ¤W½d¨Ò
§@ªÌ: samwang    ®É¶¡: 2021-7-2 17:16

¦^´_ 25# wang077

½Ð´ú¸Õ¬Ý¬Ý¡A¥i½Æ¿ïÀɮסAÁÂÁ¡C

Sub ¿ï¾ÜÀÉ®×()
Dim Arr, WB, fc%, x%, fn$, n%
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.AskToUpdateLinks = False

With Sheets("Á`ªí")
    If .FilterMode Then .ShowAllData
    .Range("a2:j" & .[a65536].End(3).Row) = ""
    With Application.FileDialog(msoFileDialogOpen)
        .InitialFileName = "D:\"
        .AllowMultiSelect = True
        .Show
        fc = .SelectedItems.Count
        If fc = 0 Then Exit Sub
        Tm = Timer
        For x = 1 To fc
            FPath = .SelectedItems(x)
            Set WB = Workbooks.Open(FPath)
            With Sheets(1)
                If .FilterMode Then .ShowAllData
                Arr = .Range("a3:i" & .[a65536].End(3).Row)
                fn = Split(ActiveWorkbook.Name, ".")(0)
            End With
            WB.Close
        n = [a65536].End(xlUp).Row + 1
        Range("a" & n).Resize(UBound(Arr), UBound(Arr, 2)) = Arr
        Range("j" & n & ":j" & [a65536].End(xlUp).Row) = fn
        Next
    End With
End With

Application.ScreenUpdating = True
Application.DisplayAlerts = True
Application.AskToUpdateLinks = True
MsgBox "°õ¦æ§¹¦¨" & Timer - Tm & " ¬í"
End Sub
§@ªÌ: wang077    ®É¶¡: 2021-7-5 08:00

¦^´_ 26# samwang
´ú¸Õ¹L¤F¡A¨S°ÝÃD¡A«D±`·PÁ¤j¤j
¤j¤j¥i¥Hµy·L¸ÑÄÀ¤@¤U³o¨Çµ{¦¡½X¶Ü
¤p§Ì¯à¤O¸û®t¡A»Ý­n²z¸Ñ
§@ªÌ: samwang    ®É¶¡: 2021-7-5 08:19

¦^´_ 27# wang077

§Ú¤]¬O·s¤â¾Ç²ß¤¤¡A¼g±o¤£¦n½Ð¨£½Ì¡AÁÂÁ¡C

Sub ¿ï¾ÜÀÉ®×()
Dim Arr, WB, fc%, x%, fn$, n%
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.AskToUpdateLinks = False

With Sheets("Á`ªí")
    If .FilterMode Then .ShowAllData                '¦³¿z¿ï®É¸Ñ°£¿z¿ï
    .Range("a2:j" & .[a65536].End(3).Row) = ""      '²M°£¸ê®Æ
    With Application.FileDialog(msoFileDialogOpen)  '¿ï¾Ü»Ý¨DÀÉ®×
        .InitialFileName = "D:\"                    '¹w³]D¼Ñ
        .AllowMultiSelect = True                    '¥i½Æ¿ï
        .Show                                       'µe­±Åã¥Ü
        fc = .SelectedItems.Count                   '­pºâ¿ï¾ÜÀÉ®×¼Æ
        If fc = 0 Then Exit Sub                     '¨S¿ïÀɮ׫hÂ÷¶}
        Tm = Timer                                  '¶}©l­p®É
        For x = 1 To fc
            FPath = .SelectedItems(x)               'Àɮ׸ô®|
            Set WB = Workbooks.Open(FPath)          '¶}±ÒÀÉ®×
            With Sheets(1)                          'Àɮתº²Ä1 sheet
                If .FilterMode Then .ShowAllData    '¦³¿z¿ï®É¸Ñ°£¿z¿ï
                Arr = .Range("a3:i" & .[a65536].End(3).Row)         '¨Ó·½¸Ë¤J¼Æ²Õ
                fn = Split(ActiveWorkbook.Name, ".")(0)             '¨ú±oÀɦW
            End With
            WB.Close                                                'Ãö³¬¨Ó·½ÀÉ®×
        n = [a65536].End(xlUp).Row + 1                              'Á`ªíaÄæ³Ì«á¤@µ§¸ê®Æ+1ªº¦ì¸m
        Range("a" & n).Resize(UBound(Arr), UBound(Arr, 2)) = Arr    '¨Ó·½¶K¤JÁ`ªí
        Range("j" & n & ":j" & [a65536].End(xlUp).Row) = fn         '¨Ó·½ªºÀɦW¶K¤JÁ`ªí
        Next
    End With
End With

Application.ScreenUpdating = True
Application.DisplayAlerts = True
Application.AskToUpdateLinks = True
MsgBox "°õ¦æ§¹¦¨" & Timer - Tm & " ¬í"
End Sub
§@ªÌ: wang077    ®É¶¡: 2021-7-5 09:16

¦^´_ 26# samwang
[attach]33506[/attach]
¤j¤j¡A§A¥i¥HÀ°§Ú¬Ý¤@¤U¶Ü
·J¾ã¹L¥hªº¸ê®Æ¦³¨Ç®æ¦¡·|¶]±¼
µM«á¡A¦³¿ìªk³s¨ç¼Æ¤@°_·|¾ã¹L¥h¶Ü
§@ªÌ: samwang    ®É¶¡: 2021-7-5 10:22

¥»©«³Ì«á¥Ñ samwang ©ó 2021-7-5 10:23 ½s¿è

¦^´_ 29# wang077

½Ð¦A¸Õ¬Ý¬Ý¡AÁÂÁÂ

Sub test2()
Dim Arr, WB, fc%, x%, fn$, n%
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.AskToUpdateLinks = False
fileorg = ActiveWorkbook.Name
n = 1

With Sheets("Á`ªí")
    If .FilterMode Then .ShowAllData
    .Range("a1:AA" & .[a65536].End(3).Row).Delete
    With Application.FileDialog(msoFileDialogOpen)
        .InitialFileName = "D:\"
        .AllowMultiSelect = True
        .Show
        fc = .SelectedItems.Count
        If fc = 0 Then Exit Sub
        Tm = Timer
        For x = 1 To fc
            FPath = .SelectedItems(x)
            Set WB = Workbooks.Open(FPath)
            With Sheets(1)
                If .FilterMode Then .ShowAllData
                fn = Split(ActiveWorkbook.Name, ".")(0)
                .Range("a1:z" & .[a65536].End(3).Row).Copy Workbooks(fileorg).Sheets("Á`ªí").Range("a" & n)
            End With
            WB.Close
            Range("AA" & n & ":AA" & [a65536].End(xlUp).Row) = fn
            n = [a65536].End(xlUp).Row + 1

        Next
    End With
End With

Application.ScreenUpdating = True
Application.DisplayAlerts = True
Application.AskToUpdateLinks = True
MsgBox "°õ¦æ§¹¦¨" & Timer - Tm & " ¬í"
End Sub
§@ªÌ: wang077    ®É¶¡: 2021-7-5 10:26

¦^´_ 28# samwang
[attach]33508[/attach]
¤j¤j©êºp¡A§Ú²{¦b¦pªG­n­×§ï¦¨
¦bªí³æªºTextBox¤¤¿é¤J¾÷1
´N·|§â¾÷1ªº¸ê®Æcopy¹L¨Ó
¦pªG³£¨S¦³¿é¤J¡A´N§â¸ê®Æ§¨ùتºÀɮ׸ê®Æ³£copy¹L¨Ó
§@ªÌ: wang077    ®É¶¡: 2021-7-5 13:14

¦^´_ 30# samwang
´ú¸Õ¹L¤F¡A¨S°ÝÃD
31#ªº°ÝÃD¦³¸Ñ¶Ü?
§@ªÌ: wang077    ®É¶¡: 2021-7-5 16:25

¦^´_ 32# wang077
¤j¯«¦³¸Ñ¶Ü?
§Ú·Q¯}ÀY¡A«ç»ò¸Õ¡A³£¸Ñ¤£¥X¨Ó
§@ªÌ: samwang    ®É¶¡: 2021-7-6 07:47

¥»©«³Ì«á¥Ñ samwang ©ó 2021-7-6 07:49 ½s¿è

¦^´_ 31# wang077 [/

±N»Ý­n½Æ»sªºÀɮשñ¦b¬Y­Ó¸ê®Æ§¨
¶}±Òªí³æ«á¿ï¨ú¨º­Ó¸ê®Æ§¨
·|¦Û°ÊÅã¥Ü¥X¨º­Ó¸ê®Æ¸ÌªºÀɮצWºÙ
¿ï¨úÀɦWµM«á½Æ»s
½Ð´ú¸Õ¬Ý¬Ý
ÁÂÁÂ
§@ªÌ: wang077    ®É¶¡: 2021-7-6 08:20

¦^´_ 34# samwang
¤j¤j¡A¦A³Â·Ð§A±H¨ì§Úªºmail¤F
§@ªÌ: samwang    ®É¶¡: 2021-7-6 08:41

¦^´_ 35# wang077


¤w±Hµ¹±z¤F¡AÁÂÁÂ
§@ªÌ: wang077    ®É¶¡: 2021-7-6 09:13

¦^´_ 36# samwang
´ú¸Õ¹L¤F¡A¨S°ÝÃD
«D±`·PÁ¤j¤j¡A¤@ª½³Â·Ð§A¡A¨¯­W¤F
§@ªÌ: s3526369    ®É¶¡: 2021-7-6 17:01

[attach]33521[/attach]
§A¬O·Q¹³³o¼Ë³æ¿W¿ï¨ú§A­nªº¤º®e¶Ü?
  1. With ListBox1
  2.           .ListStyle = 1  '§Ç«e¤è®Ø®Ø
  3. End With
½Æ»s¥N½X
«e¤è¥[¤J¤p®Ø®Ø ´N¥i¥H³æ¿W¿ï¨ú
§@ªÌ: wang077    ®É¶¡: 2021-7-6 17:08

¦^´_ 36# samwang
¤j¤j¡A©êºp¡A§Ú¤S¦³³Â·Ð¤F
¦pªG¶}±Òªí³æ«á­nª½±µ§â¾÷1¡A¾÷2¥s¥X¨Ó¦bListBox¤W©O¡Aµ¥©ó¤£­n¦³¿ï¾Ü¸ê®Æ§¨³o¨BÆJ
§@ªÌ: samwang    ®É¶¡: 2021-7-6 17:39

¦^´_ 39# wang077


¦pªG¶}±Òªí³æ«á­nª½±µ§â¾÷1¡A¾÷2¥s¥X¨Ó¦bListBox¤W©O¡Aµ¥©ó¤£­n¦³¿ï¾Ü¸ê®Æ§¨³o¨BÆJ
>>  ¦]¬°­n¿ï¨ú¸ê®Æ§¨¤~¯à±oª¾¦³­þ¨ÇÀɮסA¤£µMµLªkª¾¹D¦³¨º¨ÇÀɦW¡A¦p¾÷1¡A¾÷2¡B¾÷3...µ¥µ¥
§@ªÌ: wang077    ®É¶¡: 2021-7-6 19:24

¦^´_ 40# samwang
¨º¦pªGª½±µ§â¾÷1¡B¾÷2¨º­Ó¸ê®Æ§¨·í¹w³]ªº¸ê®Æ§¨©O¡H
§@ªÌ: samwang    ®É¶¡: 2021-7-6 20:14

¥»©«³Ì«á¥Ñ samwang ©ó 2021-7-6 20:20 ½s¿è

¦^´_ 41# wang077

ÁÙ¬O¦³°ÝÃD¡A¦]¬°µLªk±oª¾¾÷1¾÷2ªº¸ô®|¡A©Ò¥HµLªk¶}±ÒÀɮסA°£«D¬O©T©w¸ô®|©Î»Pµ{¦¡Àɮשñ¦P¤@­Ó¸ô®|¡A
¥t¥~±z10¼Ó»¡¦³¦n¦h­Ó¾÷¥x¡A¨º¬°¤°»ò²{¦b¥u¦³¹w³]¾÷1¾÷2?¬O¥t¥~»Ý¨D¶Ü?
§@ªÌ: wang077    ®É¶¡: 2021-7-7 07:56

¦^´_ 42# samwang
¦]¬°¾÷1¡A¾÷2¬O§Ú§ì¥X¨Ó·í½d¨Ò¥Î¡A¤§«á¦pªG§¹¦¨ÁÙ·|¥[¤J§ó¦h
¨º¦pªG¸ê®Æ§¨ªº¸ô®|¬O©T©wªº¡AÀɮפ]³£©T©w©ñ¦b¸ê®Æ§¨ùتº¸Ü©O?
§@ªÌ: samwang    ®É¶¡: 2021-7-7 08:29

¦^´_ 43# wang077

´£¨Ñ2ºØ¤èªk¡A½Ð´ú¸Õ¬Ý¬Ý¡AÁÂÁÂ

Private Sub UserForm_Activate()
Dim fs, f, fc, xD, a
Set fs = CreateObject("Scripting.FileSystemObject")
Set xD = CreateObject("Scripting.Dictionary")
'a = ThisWorkbook.Path  'µ{¦¡ÀÉ»P¸ê®ÆÀÉ©ñ¦P¤@­Ó¸ê®Æ§¨
a = "D:\test"                       '¸ê®ÆÀÉ©ñ¦b©T©w¸ô®|
fnorg = ActiveWorkbook.Name
Set f = fs.GetFolder(a)
Set fc = f.Files
For Each f1 In fc
    n = n + 1
    If InStr(f1.Path, fnorg) Then GoTo 99
    Arr(n, 1) = f1.Path
    Arr(n, 2) = Split(f1.Name, ".")(0)
    xD(Arr(n, 2) & "") = ""
99: Next
Me.ListBox1.List = xD.keys
Set fs = Nothing: Set f = Nothing: Set fc = Nothing: Set xD = Nothing
EndSub:
End Sub
§@ªÌ: wang077    ®É¶¡: 2021-7-7 09:03

¦^´_ 44# samwang
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.AskToUpdateLinks = False
fileorg = ActiveWorkbook.Name
Set xD = CreateObject("Scripting.Dictionary")
For i1 = 1 To n1
    If Not xD.Exists(Ar(i1, 1) & "") Then
        xD(Ar(i1, 1) & "") = ""
        For i = 1 To n
            If Arr(i, 2) = Ar(i1, 1) Then n2 = n2 + 1: Ar1(n2, 1) = Arr(i, 1)
        Next
    End If
Next
R = 1: Sheets("6¤ë¥÷¼Æ¾Ú").Select
With Sheets("6¤ë¥÷¼Æ¾Ú")
    If .FilterMode Then .ShowAllData
    .Range("a1:AA" & .[a65536].End(3).Row).Delete
    Tm = Timer
    For i1 = 1 To n2
        Set WB = Workbooks.Open(Ar1(i1, 1))
        With Sheets("6¤ë¥÷¼Æ¾Ú")
            If .FilterMode Then .ShowAllData
            fn = Split(ActiveWorkbook.Name, ".")(0)
            .Range("a1:z" & .[a65536].End(3).Row).Copy Workbooks(fileorg).Sheets("6¤ë¥÷¼Æ¾Ú").Range("a" & R)
        End With
        WB.Close
        .Range("U" & R & ":U" & .[a65536].End(xlUp).Row) = fn
        R = .[a65536].End(xlUp).Row + 1
    Next
End With
MsgBox "¸ê®Æ½Æ»s§¹¦¨" & Timer - Tm & "¬í"
Erase Arr: Erase Ar
Unload Me

Application.ScreenUpdating = True
Application.DisplayAlerts = True
Application.AskToUpdateLinks = True

½Æ»s¸ê®Æªº®É­Ô
Set WB = Workbooks.Open(Ar1(i1, 1))
³o¦æ¥X²{¤F¿ù»~
[attach]33522[/attach]
§@ªÌ: wang077    ®É¶¡: 2021-7-7 09:10

¦^´_ 45# wang077
§ä¨ì¿ù»~¤F¡A­è­è§âµ{¦¡ÀÉ©ñ¦A¦P¤@­Ó¸ê®Æ§¨¡A©Ò¥H¥X²{¿ù»~
¥H¸Ñ¨M³o¿ù»~
§@ªÌ: s3526369    ®É¶¡: 2021-7-7 10:12

¦^´_ 1# wang077
[attach]33523[/attach]
  1. With ListBox1
  2.           .ListStyle = 1  '§Ç«e¤è®Ø®Ø
  3. End With
½Æ»s¥N½X

§@ªÌ: wang077    ®É¶¡: 2021-7-7 10:39

¥»©«³Ì«á¥Ñ wang077 ©ó 2021-7-7 10:40 ½s¿è

¦^´_ 44# samwang
Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.AskToUpdateLinks = False
fileorg = ActiveWorkbook.Name
Set xD = CreateObject("Scripting.Dictionary")
For i1 = 1 To n1
    If Not xD.Exists(Ar(i1, 1) & "") Then
        xD(Ar(i1, 1) & "") = ""
        For i = 1 To n
            If Arr(i, 2) = Ar(i1, 1) Then n2 = n2 + 1: Ar1(n2, 1) = Arr(i, 1)
        Next
    End If
Next
R = 1: Sheets("6¤ë¥÷¼Æ¾Ú").Select
With Sheets("6¤ë¥÷¼Æ¾Ú")
    If .FilterMode Then .ShowAllData
    .Range("a1:AA" & .[a65536].End(3).Row).Delete
    Tm = Timer
    For i1 = 1 To n2
        Set WB = Workbooks.Open(Ar1(i1, 1))
        With Sheets("6¤ë¥÷¼Æ¾Ú")
            If .FilterMode Then .ShowAllData
            fn = Split(ActiveWorkbook.Name, ".")(0)
            .Range("a1:z" & .[a65536].End(3).Row).Copy Workbooks(fileorg).Sheets("6¤ë¥÷¼Æ¾Ú").Range("a" & R)
        End With
        WB.Close
        .Range("U" & R & ":U" & .[a65536].End(xlUp).Row) = fn
        R = .[a65536].End(xlUp).Row + 1
    Next
End With
MsgBox "¸ê®Æ½Æ»s§¹¦¨" & Timer - Tm & "¬í"
Erase Arr: Erase Ar

Application.ScreenUpdating = True
Application.DisplayAlerts = True
Application.AskToUpdateLinks = True
End Sub

   


¤j¤j¡A§Ú§â½Æ»s¸ê®Æªºµ{¦¡½X¥á¶i¥hListBox1_DblClick¸Ì­±
¥i¥Hª½±µ¿ï¨úListBox¨Ó¥s¥X¸ê®Æ¡A¦ý§Ú¦pªG²Ä¤@¦¸ÂIÀ»¾÷1¥i¥H¥s¥X¾÷1ªº¸ê®Æ¡A§Ú²Ä¤G¦¸ÂIÀ»¾÷2ªº®É­Ô
¥L¤SÅã¥Ü³o¿ù»~¤F
¨D¸Ñ¡I
[attach]33525[/attach]
§@ªÌ: wang077    ®É¶¡: 2021-7-7 11:04

¦^´_ 47# s3526369
¦¹°ÝÃD¤w¸Ñ¨M
·PÁ¤À¨É
§@ªÌ: samwang    ®É¶¡: 2021-7-7 13:43

¦^´_ 48# wang077


§Ú´ú¸Õ¨S°ÝÃD¡A¥iªþ¥óÅý§Ú´ú¸Õ¬Ý¬Ý¶Ü? ÁÂÁÂ
§@ªÌ: wang077    ®É¶¡: 2021-7-7 14:22

¦^´_ 50# samwang
[attach]33526[/attach]
[attach]33527[/attach]
³Â·Ð¤j¤j¤F
§@ªÌ: samwang    ®É¶¡: 2021-7-7 16:11

¦^´_ 51# wang077


±z´£¨Ñªºµ{¦¡¦³°ÝÃD¡Aµ{¦¡¥»¨ÓListbox ³]©w¬°change¡A²{¦b§A¤S¦P®É³]©w¬°Listbox_DblClick
³o¼Ë¤£¦æ·|½Ä¬ð¡A¦Ó¥BDblClick¥u¯à³æ¿ï¡A¦n¹³¦³©M¤§«eªº»Ý¨D¤S¤£¤@¼Ë¡AÁÂÁ¡C

­ìµ{¦¡¬[ºc: listbox ³]¬°½Æ¿ï¡A¿ï¾Ü¾÷¸¹¡A¾÷¸¹¼È¦sAr¼Æ²Õ-->¥Îcommandbutton °õ¦æ°j°éAr¥h°µ½Æ»s°Ê§@
§@ªÌ: wang077    ®É¶¡: 2021-7-7 16:28

¦^´_ 52# samwang
§Ú«á¨Óª½±µ¦bdbl_Click
¤U¤FUnload
¦A¤Ushow
§âform­«·sshow¤@¦¸
´N¥i¥H¤F
¥i¥H¤@¦¸¦h¿ï¡A¿ï§¹2­Ó¾÷¥x«á¦blistbox¸ÌªºªÅ¥Õ³BÂI¨â¤U´N¦n¤F
§@ªÌ: samwang    ®É¶¡: 2021-7-7 16:39

¦^´_ 53# wang077


¥i¥H´£¨ÑÀɮסAÅý§Ú¾Ç²ß¤@¤U¶Ü? ÁÂÁÂ
§@ªÌ: wang077    ®É¶¡: 2021-7-8 07:55

¦^´_ 54# samwang
[attach]33531[/attach]
·Pı·|¦³§ó¦nªº¿ìªk¡A¥u¬O¥Ø«e§Ú¥u°µ¨ì³o¼Ë¦Ó¤w
§@ªÌ: wang077    ®É¶¡: 2021-7-8 11:04

¦^´_ 54# samwang
¤j¤j¡A¤£¦n·N«ä¤S¨Ó³Â·Ð§A¤F
§Ú²{¦b°µ¤F¤@­Ólistbox¨Ó¸Ë¿z¿ï±ø¥ó¡A¦ý¬O¥u¯à§ì¨ì¤@­Ó¨Ó¿z¿ï
¦³¿ìªk§ì¦h­Ó±ø¥ó¨Ó¿z¿ï¶Ü
  1. Private Sub CommandButton5_Click()
  2. For i = 0 To ListBox2.ListCount - 1
  3.         If ListBox2.Selected(i) = True Then
  4. Worksheets("Á`ªí").Range("$A$2:$T$2414").AutoFilter field:=7, Criteria1:="=" & ListBox2.List(i)
  5. End If
  6. Next
  7. End Sub
½Æ»s¥N½X
[attach]33533[/attach]
§@ªÌ: samwang    ®É¶¡: 2021-7-8 13:31

¦^´_ 56# wang077

§Ú²{¦b°µ¤F¤@­Ólistbox¨Ó¸Ë¿z¿ï±ø¥ó¡A¦ý¬O¥u¯à§ì¨ì¤@­Ó¨Ó¿z¿ï
¦³¿ìªk§ì¦h­Ó±ø¥ó¨Ó¿z¿ï¶Ü


¤£¦n·N«ä¡A¥i¥H¸ÑÄÀ²M·¡¤@ÂI¶Ü? listbox¸Ë¿z¿ï«áªºµ²ªG¶Ü?
¦ý¥u¯à§ì¤@­Ó¨Ó¿z¿ï??
§@ªÌ: samwang    ®É¶¡: 2021-7-8 13:31

¦^´_ 56# wang077

§Ú²{¦b°µ¤F¤@­Ólistbox¨Ó¸Ë¿z¿ï±ø¥ó¡A¦ý¬O¥u¯à§ì¨ì¤@­Ó¨Ó¿z¿ï
¦³¿ìªk§ì¦h­Ó±ø¥ó¨Ó¿z¿ï¶Ü


¤£¦n·N«ä¡A¥i¥H¸ÑÄÀ²M·¡¤@ÂI¶Ü? listbox¸Ë¿z¿ï«áªºµ²ªG¶Ü?
¦ý¥u¯à§ì¤@­Ó¨Ó¿z¿ï??
¦³¿ìªk§ì¦h­Ó±ø¥ó¨Ó¿z¿ï¶Ü??
§@ªÌ: wang077    ®É¶¡: 2021-7-8 14:19

¦^´_ 58# samwang
§Úªºlistbox¸Ì­±¤w¸g¦³¿z¿ï±ø¥ó¤F
¦ý§Ú¥Ø«e¥u¯àSelect¨ì1­Ó­È¨Ó¿z¿ï
§Úªº°ÝÃD¬O«ç»ò±qlistbox¸ÌSelect¦h­Ó­È¨Ó¿z¿ï
[attach]33534[/attach]
[attach]33535[/attach]
§@ªÌ: wang077    ®É¶¡: 2021-7-9 11:28

¦^´_ 34# samwang
¤j¤j¡A§Ú²{¦b§â¥¦¥á¶icombobox¸Ì
¦ý§Ú¿ï¤F¨ä¤¤¤@­Ó¡A«o·|¥þ³¡³£¥s¥X¨Ó
§@ªÌ: samwang    ®É¶¡: 2021-7-9 18:32

¦^´_ 59# wang077

½Ð´ú¸Õ¬Ý¬Ý¡AÁÂÁÂ

Private Sub CommandButton5_Click()
Dim ar2, s%
s = 0: ReDim ar2(s)
With Sheets("Á`ªí").Range("a2:u" & [a65536].End(3).Row)
    Sheets(1).AutoFilterMode = False
    For i = 0 To ListBox2.ListCount - 1
        If ListBox2.Selected(i) = True Then
            ReDim Preserve ar2(s)
            ar2(s) = CStr(ListBox2.List(i))
            s = s + 1
        End If
    Next
    .AutoFilter Field:=7, Criteria1:=ar2, Operator:=xlFilterValues
End With
Set ar2 = Nothing
End Sub
§@ªÌ: wang077    ®É¶¡: 2021-7-12 07:57

¦^´_ 61# samwang
´ú¸Õ¹L¤F¡A¨S°ÝÃD¡AÁÂÁ¤j¤j




Åwªï¥úÁ{ ³Â»¶®a±Ú°Q½×ª©ª© (http://forum.twbts.com/)