ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] VBA ¤å¥ó§¨¤£¦P¬¡­¶Ã¯½Æ»s¨ìÁ`ªí

[µo°Ý] VBA ¤å¥ó§¨¤£¦P¬¡­¶Ã¯½Æ»s¨ìÁ`ªí

¥»©«³Ì«á¥Ñ john2006168 ©ó 2021-5-25 10:50 ½s¿è

¦pªþ¥ó¦³1­Ó¤å¥ó§¨¦³´X­Óworkbook,·Q±N¸ê®Æ½Æ»s¨ìÁ`ªí,½Ð°Ý¦Ñ®v¥i§_´£¨Ñ¤èªk¾Ç²ß(¦b¤£¥´¶}test01& test 02).[attach]33330[/attach][attach]33333[/attach]

Â^¨ú02.PNG (19.17 KB)

Â^¨ú02.PNG

Â^¨ú01.PNG (12.67 KB)

Â^¨ú01.PNG

Test.zip (41.04 KB)

¦^´_ 1# john2006168


½Ð´ú¸Õ¬Ý¬Ý¡A ÁÂÁ¡C
Sub test()
Dim Arr, x%, FPath$, FD, FN, WB As Workbook, CT%, N%, M%
Application.ScreenUpdating = False
Application.AskToUpdateLinks = False
Application.DisplayAlerts = False
'========================================================================

With Application.FileDialog(msoFileDialogOpen)
    .InitialFileName = "D:\"
    .AllowMultiSelect = True
    .Show
    Tm = Timer
    For x = 1 To .SelectedItems.Count
        FPath = .SelectedItems(x)
        filedata = ActiveWorkbook.Name
        Set WB = Workbooks.Open(FPath)
        With Sheets(1)
            If .FilterMode Then .ShowAllData
            CT = Application.CountA([A1:A6636])
            If CT < 2 Then GoTo 99
            M = M + 1: FD = .[C1]
            Arr = .Range(.[K3], .[A65536].End(3))
            FN = Split(ActiveWorkbook.Name, ".")(0)
        End With
99:     WB.Close
        If M = 1 Then
            With Sheets("Summary")
                N = .Range("A65536").End(xlUp).Row + 1
                .Range("A" & N).Resize(UBound(Arr), UBound(Arr, 2)) = Arr
                .Range("I" & N).Resize(UBound(Arr)) = FD
                .Range("K" & N).Resize(UBound(Arr)) = FN
            End With
            M = 0: Erase Arr
        End If
    Next
End With

'===========================================================================
Set WB = Nothing
Application.ScreenUpdating = True
Application.AskToUpdateLinks = True
Application.DisplayAlerts = True
MsgBox "°õ¦æ§¹¦¨" & Timer - Tm & " ¬í"
End Sub

TOP

¦^´_ 2# samwang

³o­Ó«D±`¹ê¥Î,ÁÂÁÂ.

TOP

Test (2).zip (40.96 KB) ¦^´_ 2# samwang
¦Ñ®v§A¦n,·Q°Ý¤@¤U,¦pªG§Ú¸ê®Æ©T©w¦b²Ä12¦C¶}©l«ç»ò­×§ï,¦]¬°¸ê®Æ¤W¤U­±¦³¨ÇªÅ®æ©M¤å¦r.

TOP

¦^´_ 4# john2006168

§ï¬°¦p¤U§Y¥i¡AÁÂÁ¡C
Arr = .Range(.[K13], .[A12].End(4))

TOP

¦^´_ 5# samwang


    ·PÁ¦h¦¸«ü¾É.

TOP

        ÀR«ä¦Û¦b : µoµÊ®ð¬Oµu¼ÈªºµoºÆ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD