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

[µo°Ý] VBA¥i¥H°µ¨ì³]­p¼u¥X¦¡µ¡Åý¨Ï¥ÎªÌÂI¿ïÀÉ®×¥H¶×¤Jªº¥\¯à¶Ü?

[µo°Ý] VBA¥i¥H°µ¨ì³]­p¼u¥X¦¡µ¡Åý¨Ï¥ÎªÌÂI¿ïÀÉ®×¥H¶×¤Jªº¥\¯à¶Ü?

½Ð±Ð¦U¦ì«e½ú¡A¥Ø«e¤p§Ì¶×¤J.TXTÀɳ£¬O­nÂI¿ï"¸ê®Æ-¨ú±o¥~³¡¸ê®Æ-±q¤å¦rÀÉ"(2007)¨Ó¶×¤J¡A¤§«á¦A¶i¦æ¤À³Î¡C¥H¤U¬°³¡¤À¿ý»s¥X¨Óªº¤º®e¡C
QueryTables.Add(Connection:="TEXT;C:\Users\Administrator\Desktop\Excel½m²ß\test.txt", Destination:=Range("$A$1"))
­Y¦¹Àɮשñ¦b§Oªº¸ô®|¡A¥H¤Wcode´N¤£¯à¥Î¤F¡C
½Ð°Ý¬O§_¯àÂÇ¥ÑVBA¨Ó¹ê²{¸õ¥Xµøµ¡Åý¨Ï¥ÎªÌ¦Û¦æ¿ï¾ÜÀÉ®×?
ÁÂÁÂ!!

¦^´_ 11# shakeass

¶K¤å¥¢±Ñ­«¶K¤@©«sorry
    ½Ð±Ð¦U¦ì°ª¤â¤j¤j
¤p§Ì·Q­n¨Ï¥Î¿ï¾ÜÀÉ®× ¨Ã±N¿ï¾Ü¤§ÀÉ®× ½Æ»s¨ìd:\test ¸ê®Æ§¨¸Ì
¦ý¬O FILECOPY "¨Ó·½","D:\test"     ªº¨Ó·½·Q¥ÎÅܼƨú¥N «o¤@ª½¥X²{¿ù»~
¥i¥H³Â·Ð°ª¤âÀ°¦£¬Ý¤@¤U»Ý­n¦p¦ó­×§ï¤~¯à²Å¦X¶¶§Q¶]¤U¥h
Private Sub CommandButton1_Click()

With Application.FileDialog(msoFileDialogOpen)
   .AllowMultiSelect = True
   .Show
   For i = 1 To .SelectedItems.Count
     Cells(i, 1) = .SelectedItems(i)
     MsgBox .SelectedItems(i)
     fs = .SelectedItems(i)

       fileCopy(fs,"d:\test")
   Next
End With
End Sub

TOP

¦^´_ 9# Hsieh


½Ð±Ð¦U¦ì°ª¤â¤j¤j
¤p§Ì·Q­n¨Ï¥Î¿ï¾ÜÀÉ®× ¨Ã±N¿ï¾Ü¤§ÀÉ®× ½Æ»s¨ìd:\test ¸ê®Æ§¨¸Ì
¦ý¬O FILECOPY "¨Ó·½","D:\test"     ªº¨Ó·½·Q¥ÎÅܼƨú¥N «o¤@ª½¥X²{¿ù»~
¥i¥H³Â·Ð°ª¤âÀ°¦£¬Ý¤@¤U»Ý­n¦p¦ó­×§ï¤~¯à²Å¦X¶¶§Q¶]¤U¥h
Private Sub CommandButton1_Click()

With Application.FileDialog(msoFileDialogOpen)
   .AllowMultiSelect = True
   .Show
   For i = 1 To .SelectedItems.Count
     Cells(i, 1) = .SelectedItems(i)
     MsgBox .SelectedItems(i)
     fs = .SelectedItems(i)

       ==> Private Sub CommandButton1_Click()

With Application.FileDialog(msoFileDialogOpen)
   .AllowMultiSelect = True
   .Show
   For i = 1 To .SelectedItems.Count
     Cells(i, 1) = .SelectedItems(i)
     MsgBox .SelectedItems(i)
     fs = .SelectedItems(i)

       fileCopy(fs,"d:\test")
   Next
End With
End SubfileCopy(fs,"d:\test")
   Next
End With
End Sub
·P¿E

TOP

ÁÂÁÂHsiehª©¤j~~!!

TOP

¦^´_ 8# yafeii
  1. Sub nn()
  2. Dim FileToOpen
  3. FileToOpen = Application _
  4.     .GetOpenFilename("Text Files (*.txt), *.txt", , , , True)
  5. If IsArray(FileToOpen) Then
  6.     MsgBox Join(FileToOpen, Chr(10))
  7.     ElseIf FileToOpen <> False Then
  8.     MsgBox FileToOpen
  9. End If
  10. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

ÁÂÁÂHsieh¤j,½Ð°Ý¤@©w­n¥ÎApplication.FileDialog(msoFileDialogOpen),¤£¯à¥ÎGetOpenFilename¶Ü?ÁÂÁÂ!!

TOP

¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

½Ð±Ð°ª¤â­Ì,¦pªG§Æ±æ¦b¼u¥X¦¡µ¡Åý¨Ï¥ÎªÌ¦P®ÉÂI¿ï¦h­ÓÀɮ׶פJ
®ÉÀ³¦p¦ó³]©w©O?ÁÂÁÂ!!

TOP

¦^´_ 4# oobird

ÁÂÁÂoobirdªº¦^ÂСA­ì¨Ó¨Ï¥ÎGetOpenFilename¤èªk´N¥i¥H¤F¡C
·P¶â!

TOP

Dim Fname As String
Fname = Application.GetOpenFilename("¤å¦r¤å¥ó,*.txt")
If len(Fname)>0  Then

TOP

        ÀR«ä¦Û¦b : ¹D¼w¬O´£ª@¦Û§Úªº©ú¿O¡A¤£¸Ó¬O¨þ¥¸§O¤HªºÃ@¤l¡C
ªð¦^¦Cªí ¤W¤@¥DÃD