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

[µo°Ý] »yªk°ÝÃD

¥»©«³Ì«á¥Ñ linsurvey2005 ©ó 2012-1-12 16:16 ½s¿è

¦^´_ 7# lcc_seven


    lcc_seven «e½ú¦n:
    «ç»ò¹B¥Î¦b¤w¸g¶}±ÒªºÀÉ®×
       ¤ñ¦p:¤w¸g¶}±ÒÀÉ®×"123.xls",±ø¥ó¤£²Å´N§R°£ÀÉ®×"123.xls"
           ±ø¥ó¦¡ IF Sheets(1).Range("A1") <> "123" Then  ActiveWorkbook.Name.Delete   '§R°£ÀÉ®×"123.xls"
¶}¤ß¾Ç²ß,¾Ç²ß«Ü¶}¤ß

TOP

¦^´_ 11# linsurvey2005
  1. Sub Ex()
  2.     Dim F As String
  3.     If Sheets(1).Range("A1") <> "123" Then
  4.         With ActiveWorkbook
  5.             F = .FullName      '¶Ç¦^ª«¥óªº¦WºÙ¡A¥]¬A¨äºÏºÐ¸ô®|
  6.             .Close 0           'Ãö³¬ÀÉ®×
  7.         End With
  8.         Kill F     '§R°£ÀÉ®×"123.xls
  9.     End If
  10. End Sub
½Æ»s¥N½X

TOP

¦^´_ 12# GBKEE


GBKEE «e½ú¦n:
¥u¯àÃö³¬Àɮפ£¯à¾ã­Ó§R°£(¥]§t©U§£±í¤]¬O)~^.^
¤ñ¤è»¡Àɮצs©ñ¸ô®|"D:\test¾ã­Ó®ø¥¢¦b¹q¸£\123.xls"----¸ò¦s©ñ¸ô®|¦³®t§O¶Ü?
¸ô®|¦Û°Ê§ì¨ú¤ñ¸û¤è«K~½Ð±Ð¦³¤T
¶}¤ß¾Ç²ß,¾Ç²ß«Ü¶}¤ß

TOP

¦^´_ 13# linsurvey2005
¥u¯àÃö³¬Àɮפ£¯à¾ã­Ó§R°£(¥]§t©U§£±í¤]¬O)
¬O123.xlsÀɮפ£¯à§R°£¶Ü? ,  ½Ð°Ý  Sheets(1).Range("A1")   ¬O 123.xlsªºSheets(1) ,
¨º·íµM§R¤£±¼
           .Close 0           '¥ýÃö³¬ÀÉ®×
        End With
        Kill F     '§R°£ÀÉ®×"123.xls ¨S¿ìªk°õ¦æ


¦]¬°§Aªº»¡ªº¤£¬O«Ü²M·¡!!

TOP

¥»©«³Ì«á¥Ñ HSIEN6001 ©ó 2012-7-12 12:14 ½s¿è

¦^´_ 14# GBKEE

½Ð°ÝGBKEE¤j,¦p¦ó§¹¦¨

»Ý¨D¡G
¸ê®Æ§¨¤º "ANY*.xls" ªº©Ò¦³ÀɦW
¦pªG¸Óªí®æSheets(1).Range("A2") <> "¤é´Á"
´N§R°£¸ÓÀÉ®×.xls
  1. Sub Ex()
  2. Dim F As String, xpath As String, xfile As String
  3. xpath = "D:\´ú¸Õ\"
  4. xfile = Dir(xpath & "ANY*.xls")
  5.     Do While xfile <> ""
  6.         If Sheets(1).Range("A2") <> "¤é´Á" Then
  7.             With ActiveWorkbook
  8.                 F = .FullName      '¶Ç¦^ª«¥óªº¦WºÙ¡A¥]¬A¨äºÏºÐ¸ô®|
  9.                 .Close 0           'Ãö³¬ÀÉ®×
  10.             End With
  11.             Kill F     '§R°£ÀÉ®×"123.xls
  12.         End If
  13.         xfile = Dir
  14.     Loop
  15. End Sub
½Æ»s¥N½X
°õ¦æµ²ªG·|ª½±µÃö³¬¥¨¶°¸ÓÀÉ®×

TOP

¥»©«³Ì«á¥Ñ HSIEN6001 ©ó 2012-7-12 12:18 ½s¿è

¦^´_ 12# GBKEE


§Ú²×©ó·Q³q¤F^^
[¤w¸Ñ¨M]
  1. Sub EX()
  2.     Dim F As String, xpath As String, xfile As String
  3.     xpath = "D:\´ú¸Õ\"   
  4.     xfile = Dir(xpath & "ANY*.xls")
  5.     Do While xfile <> ""
  6.         With Workbooks.Open(xpath & xfile)
  7.         If Sheets(1).Range("A2") <> "¤é´Á" Then
  8.             With ActiveWorkbook
  9.                 F = .FullName      '¶Ç¦^ª«¥óªº¦WºÙ¡A¥]¬A¨äºÏºÐ¸ô®|
  10.                 .Close 0           'Ãö³¬ÀÉ®×
  11.             End With
  12.         End If
  13.     Kill F     '§R°£ÀÉ®×"123.xls
  14.         End With
  15.         xfile = Dir
  16.     Loop
  17. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¡i¦æµ½­n¤Î®É¡j¦æµ½­n¤Î®É¡A¥\¼w­n«ùÄò¡C¦p¿N¶}¤ô¤@¯ë¡A¥¼¿N¶}¤§«e¤d¸U¤£­n°±º¶¤õ­Ô¡A§_«h­«¨Ó´N¤Ó¶O¨Æ¤F¡C
ªð¦^¦Cªí ¤W¤@¥DÃD