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

¦p¦ó¥ÎFileDialog¤è¦¡¶}±Ò¸ê®Æ¨Ã±N¨ä¤º®e¶K¤W

¦p¦ó¥ÎFileDialog¤è¦¡¶}±Ò¸ê®Æ¨Ã±N¨ä¤º®e¶K¤W

Dear

FileDialog.rar (32.67 KB)

¦³¤@­Ó¥H¤WªºÀÉ®×,¦p¦ó§Q¥ÎFileDialog¤è¦¡´M§äÀÉ®×,¨Ã±NÀɮתº¤º®eCopy¦ÜSheet(Data)¤º
¦]Àɮפº®e²Ä¤@Äæ¼ÐÃD¬Ò¤@¼Ë,©Ò¥H¥u»ÝCopy ¤@¦¸§Y¥i

TOP

³£¨S¦³¸Ñµª³á~~

TOP

¦^´_ 1# peter631114

¤£À´§Aªº·N«ä ¦p¦ó¬O­n±NFileDialog¸ô®|¶K¤Wªº¸Ü ¥i¥H°Ñ¦Ò³o­Ó¡A
±N§A¶}±Òªº¸ô®|¦W¶K¨ìA1Àx¦s®æ¡G
   If fDialog.Show = -1 Then
      Range("A1").Value = fDialog.SelectedItems(1)
   End If

TOP

¥»©«³Ì«á¥Ñ n7822123 ©ó 2020-4-9 13:05 ½s¿è

¦^´_ 3# peter631114

¸Õ¸Õ¬Ý¡AÃiªº¼gµù¸Ñ¤F¡A¦³°ÝÃD¦A°Ý
  1. Sub ¿ïÀɶK¤W()
  2. Dim ExFile()
  3. Application.ScreenUpdating = False
  4. With Application.FileDialog(msoFileDialogFilePicker)
  5.   .Filters.Clear
  6.   .Filters.Add "ExcelÀÉ®×", "*.xls*"
  7.   .InitialFileName = ThisWorkbook.Path
  8.   .AllowMultiSelect = True
  9.   If .Show = 0 Then Exit Sub
  10.   ReDim ExFile(1 To .SelectedItems.Count)
  11.   For Each FN In .SelectedItems: n% = n% + 1: ExFile(n) = FN: Next
  12. End With
  13. Set ¦¹ªí = ActiveSheet: Set Dataªí = Sheets("Data")
  14. For Each FN In ExFile
  15.   With Workbooks.Open(FN).Sheets(1): Dataªí.Activate
  16.     If [A1] = "" Then
  17.       .[A1].CurrentRegion.Copy [A1]
  18.     Else
  19.       .[A1].CurrentRegion.Offset(1).Copy [A1].End(4).Offset(1)
  20.     End If
  21.     .Parent.Close False
  22.   End With
  23. Next
  24. Dataªí.Columns.AutoFit
  25. Set ¦¹ªí = Nothing: Set Dataªí = Nothing: Erase ExFile
  26. End Sub
½Æ»s¥N½X
FileDialog-OK.rar (35.26 KB)
µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

TOP

¥»©«³Ì«á¥Ñ n7822123 ©ó 2020-4-9 13:54 ½s¿è

¦^´_ 5# n7822123

¼g²µu¤@ÂI¡A¨Ã¦^¨ì«ö¶s­¶(¹³¬O¤°»ò³£¨Sµo¥Í)

  1. Sub ¿ïÀɶK¤W()
  2. Application.ScreenUpdating = False
  3. Set ¦¹ªí = ActiveSheet: Set Dataªí = Sheets("Data")
  4. With Application.FileDialog(msoFileDialogFilePicker)
  5.   .Filters.Clear
  6.   .Filters.Add "ExcelÀÉ®×", "*.xls*"
  7.   .InitialFileName = ThisWorkbook.Path
  8.   .AllowMultiSelect = True
  9.   If .Show = 0 Then Exit Sub
  10.   For Each FN In .SelectedItems
  11.     With Workbooks.Open(FN).Sheets(1): Dataªí.Activate
  12.       If [A1] = "" Then
  13.         .[A1].CurrentRegion.Copy [A1]
  14.       Else
  15.         .[A1].CurrentRegion.Offset(1).Copy [A1].End(4).Offset(1)
  16.       End If
  17.       .Parent.Close False
  18.     End With
  19.   Next
  20. End With
  21. Dataªí.Columns.AutoFit: ¦¹ªí.Activate
  22. Set ¦¹ªí = Nothing: Set Dataªí = Nothing
½Æ»s¥N½X
FileDialog-OK.rar (31.72 KB)
µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

TOP

        ÀR«ä¦Û¦b : ½_ÁJµ²±o¶V¹¡º¡¡A¶V·|©¹¤U««¡A¤@­Ó¤H¶V¦³¦¨´N¡A´N­n¶V¦³Á¾¨Rªº¯ÝÃÌ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD