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

½Ð°Ý¦p¦ó¥ÎVBA¶}±ÒÀÉ®×Á`ºÞµøµ¡Åª¨úFolder©ÎFilesªº¸ô®|orÀɦW

½Ð°Ý¦p¦ó¥ÎVBA¶}±ÒÀÉ®×Á`ºÞµøµ¡Åª¨úFolder©ÎFilesªº¸ô®|orÀɦW

Dear ¦U¦ì¤j¤j¡A

½Ð°Ý¤j¤j¦³¨S¦³¿ìªkÅýuser ¦bExcel¸Ì­± «ö¤UButton µM«á´N·|¬Ý¨ìÀÉ®×Á`ºÞµøµ¡(Ãþ¦ü¦sÀɵe­±ªºµøµ¡)¡AµM«á«ü¥t¤@­Ó¸ô®|¡C
ÅýUser ¿ï¨úÀɮק¨©ÎÀɮסAµM«á¥i¥H½Æ»s¸ÓÀÉ®× ©Î Àɮק¨ªº ¸ô®| or ÀɦW¡C

¿ï¦n«á¸ô®|orÀɦW~  ·|¦Û°Ê½Æ»s¨ì¬Y¦s®æ¤W¡C

ÁÂÁ¦U¦ì¼F®`ªº¤j¤j~!!

¥Ø«e§Ú¥uª¾¹D¥i¥H¥´¶}µøµ¡¦Ó¤w  ºô¸ô¤W¬d¨ìªº¬O³o¼Ë  

Fname = Application.GetOpenFilename
ÁÙ¦³À˵øÀÉ®× ¥ÎMsgBoxÅã¥Ü
Dim NextFile As String
   Dim AllFiles As String

   AllFiles = ""
   NextFile = Dir("C:\", 0)

   While NextFile  <> ""
      AllFiles = AllFiles & Chr(13) &  NextFile
      NextFile  = Dir
   Wend

   MsgBox AllFiles

ÁÂÁ¦U¦ì¤j¤j~

  1. Private Sub CommandButton1_Click()
  2. With Application.FileDialog(msoFileDialogOpen)
  3.    .AllowMultiSelect = True
  4.    .Show
  5.    For i = 1 To .SelectedItems.Count
  6.      Cells(i, 1) = .SelectedItems(i)
  7.      MsgBox .SelectedItems(i)
  8.    Next
  9. End With
  10. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 2# Hsieh


ÁÂÁª©¥D~
½Ð°Ý«á¥b¬q
§Ú¤£¤ÓÀ´¡A§Ú·Qª¾¹D¦pªG¬O­n«ü©w¶K¦^¸ô®|¨ì¬Y¤@Àx¦s®æ ¸Ó«ç»ò¼g©O?

ÁÂÁª©¥D¤j¤j!!
  1. For i = 1 To .SelectedItems.Count
  2.      Cells(i, 1) = .SelectedItems(i)
  3.      MsgBox .SelectedItems(i)
  4.    Next
  5. End With
  6. End Sub
½Æ»s¥N½X

TOP

¦^´_ 3# webbliu

¦b¤W­±ªºµ{¦¡¸Ì´N¦³¶K¨ìÀx¦s®æ¸Ìªº¥\¯àÅo.

Cells(i, 1) = .SelectedItems(i)

´N¬O±N©Ò¿ïªºÀɦW¨Ì§Ç¶K¨ì A1  A2  A3 ... ªºÀx¦s®æ¤º,

Cells(a, b)
a ¬°¦C¸¹  1,2,3,4...
b ¬°Ä渹 A,B,C,D...

©Ò¥H Cells(i, 1) ´Nªí¥Ü A1 Àx¦s®æ.

TOP

¦^´_ 4# luhpro


    ÁÂÁ¤j¤j~ §Ú§¹¥þ©ú¥Õ¤F!!

TOP

¦^´_ 2# Hsieh


    ÁÂÁª©¥Dªº«ü¾É!!

TOP

¤j®v:
     ¦pªG§Ú­n¶}±Òªº¸ô®|¬O: D\¤å¥óÀÉ\ªþÄÝÀÉ®×
½Ð°Ýµ{¦¡­n«ç»ò­×§ï?

TOP

¦^´_ 7# ¨Ø¥È
Private Sub CommandButton1_Click()
    With Application.FileDialog(msoFileDialogOpen)
        .InitialFileName = "D\¤å¥óÀÉ\ªþÄÝÀÉ®×"
        .AllowMultiSelect = True
        .Show
        For i = 1 To .SelectedItems.Count
            Cells(i, 1) = .SelectedItems(i)
            MsgBox .SelectedItems(i)
        Next
    End With
End Sub

TOP

Shell "explorer D:\¤å¥óÀÉ\ªþÄÝÀÉ®×"

TOP

OK~~·PÁÂ~~

TOP

        ÀR«ä¦Û¦b : ¤Ñ¤W³Ì¬ü¬O¬P¬P¡A¤H¥Í³Ì¬ü¬O·Å±¡¡C
ªð¦^¦Cªí ¤W¤@¥DÃD