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

¤º®e¬°excel 2003ªºµ{¦¡½X¡A½Ð°Ý¦U¦ì¤j¤j¦p¦b2010ª©¥»¸Ó¦p¦ó­×§ï¡AÁÂÁÂ

¤º®e¬°excel 2003ªºµ{¦¡½X¡A½Ð°Ý¦U¦ì¤j¤j¦p¦b2010ª©¥»¸Ó¦p¦ó­×§ï¡AÁÂÁÂ

Public Sub FileSearch(Target)
'ÀÉ®×·j´M¥Î°Æµ{¦¡
'With Application.FileSearch
     Application.FileSearch.NewSearch
     Application.FileSearch.LookIn = "E:\"
     Application.FileSearch.SearchSubFolders = True
     Application.FileSearch.Filename = Target
     Application.FileSearch.MatchTextExactly = True
     Application.FileSearch.FileType = msoFileTypeAllFiles
     If Application.FileSearch.Execute() = 1 Then
        Filegot = Application.FileSearch.FoundFiles(1)
        Exit Sub
     Else
        If Application.FileSearch.Execute() = 7 Then: Exit Sub
        If InStr(Target, "ĵ³ø°O¿ý.csv") > 0 Then: MsgBox "½Ð±N·í¤éÀô±±­ì©lÀɮשñ¤J¥úºÐ¾÷" & vbCrLf & vbCrLf & "©Î½T»{ 7 ­ÓÀô±±­ì©lÀɦW¥¿½T": End
        MsgBox "¥úºÐ¤º§ä¤£¨ì©Î¦³¨â­Ó¥H¤W " & Target & "¡A½Ð«ü©wÀɮצì¸m"
        Filegot = Application.GetOpenFilename(UCase(Right(Target, 3)) & " Files (*" & Right(Target, 4) & "),*" & Right(Target, 4)) '¤â°Ê¨úÀÉ
        If InStr(Filegot, Replace(Left(Target, Len(Target) - 4), "*", "")) = 0 Then: MsgBox "Àɮ׿ï¾Ü¿ù»~" & vbCrLf & vbCrLf & "½Ð¿ï¾Ü" & Target: End
   
'End With
End Sub

  1. Public Sub FileSearch(Target)
  2. fd = "E:\" '«ü©w¥úºÐ¾÷
  3. Filegot = Dir(fd & "*" & Target & "*") '§ä¥X§t¦³Target¤§ÀɮצWºÙ
  4. Do Until Filegot = ""
  5. cnt = cnt + 1 '­pºâÃþ¦üÀɦW­Ó¼Æ
  6. Filegot = Dir
  7. Loop
  8. If cnt = 1 Then
  9.   If InStr(Target, "ĵ³ø°O¿ý.csv") > 0 Then: MsgBox "½Ð±N·í¤éÀô±±­ì©lÀɮשñ¤J¥úºÐ¾÷" & vbCrLf & vbCrLf & "©Î½T»{ 7 ­ÓÀô±±­ì©lÀɦW¥¿½T": End
  10.   Else
  11.   MsgBox "¥úºÐ¤º§ä¤£¨ì©Î¦³¨â­Ó¥H¤W " & Target & "¡A½Ð«ü©wÀɮצì¸m"
  12.   Filegot = Application.GetOpenFilename(UCase(Right(Target, 3)) & " Files (*" & Right(Target, 4) & "),*" & Right(Target, 4)) '¤â°Ê¨úÀÉ
  13.   If InStr(Filegot, Replace(Left(Target, Len(Target) - 4), "*", "")) = 0 Then: MsgBox "Àɮ׿ï¾Ü¿ù»~" & vbCrLf & vbCrLf & "½Ð¿ï¾Ü" & Target: End
  14. End If
  15. End Sub
½Æ»s¥N½X
¦^´_ 1# aaronprada
¸Õ¸Õ¬Ý
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

        ÀR«ä¦Û¦b : «Ý¤H°h¤@¨B¡A·R¤H¼e¤@¤o¡A´N·|¬¡±o«Ü§Ö¼Ö¡C
ªð¦^¦Cªí ¤W¤@¥DÃD