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

¨D§U---¦p¦óSave ¨Ï¨äÀɦW§À¸¹+1¦Ó¤£­«½Æ

¨D§U---¦p¦óSave ¨Ï¨äÀɦW§À¸¹+1¦Ó¤£­«½Æ

¥»©«³Ì«á¥Ñ yangjie ©ó 2011-1-19 00:57 ½s¿è

´N±Ð©ó¦U¦ìªO¥D¤j¤j:
Sub output()
    Application.DisplayAlerts = False
    path1 = ActiveWorkbook.Path
    n=1   
Sheets("¾Ç¥Í¸ê®Æ").Activate
    Sheets("¾Ç¥Í¸ê®Æ").Copy
    ActiveWorkbook.SaveAs FileName:= _
        path1&"\(" & Date$ & ")¸ê®Æ³Æ¥÷" & n &  ".xls", FileFormat:= _
        xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
        , CreateBackup:=False
    ActiveWindow.Close
End Sub
    À³¦p¦ó­×§ï ¨Ï¨ä¦Û°Ê§PŪn=? ¤~¯à¤£­«½ÆÀɦW

ÁÂÁ ·P®¦

¥»©«³Ì«á¥Ñ Hsieh ©ó 2011-1-19 14:45 ½s¿è

¦^´_ 1# yangjie
¨ú±o¸Ó¥Ø¿ýªºÀɮ׼ƶq§Y¥i
  1. Sub nn()
  2. Sheets(1).Copy
  3. d = Date$
  4. fd = ThisWorkbook.Path & "\"
  5. f = Dir(fd & d & "*.xls")
  6. Do Until f = ""
  7. n = n + 1
  8. f = Dir
  9. Loop
  10. fs = IIf(IsEmpty(n), d & ".xls", d & "_" & n & ".xls")
  11. ActiveWorkbook.SaveAs fd & fs
  12. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 2# Hsieh


    ÁÂÁª©¥D¡A°ÝÃD¸Ñ¨M¤F¡C
·Q¦A½Ð±Ð
     f = Dir(fd & d & "*.xls")
        Do Until f = ""
            n = n + 1
            f = Dir
        Loop
¬°¦ó? f = Dir ªºÅÞ¿è¬O?????? ·Q¤£À´??
½Ð½ç±Ð

TOP

¦^´_ 3# yangjie

VBA»¡©ú:
    ²Ä¤@¦¸©I¥s Dir ¨ç¼Æ®É¡A¥²¶·«ü©w pathname¡A­Y­n¨ú±o¨ä¥¦²Å¦X pathname ªºÀɮצWºÙ¡A½Ð­«·s©I¥s Dir¡A¥B¤£­n¨Ï¥Î¤Þ¼Æ
©Ò¥H·í©I¥s¹LDIR¨ç¼Æ¡AVBA§Y·|¥H¦P¶µ¥Ø¬°·j´M¥Ø¼Ð±ø¥ó
¦pªG¤w¨S¦³¦X¥G±ø¥óªºÀɮסA«h Dir ·|¶Ç¦^¤@­ÓªÅ¦r¦ê ("")¡A¤@¥¹¶Ç¦^­È¬°ªÅ¦r¦ê®É¡A¦p­n¦A¦¸©I¥s Dir ¡A¤]¥²¶·­n¦A«ü©w pathname ¡A§_«h·|²£¥Í¿ù»~¡C
©Ò¥HÅܼÆf´N¬O¨Ó§PÂ_¬O§_ÁÙ¦³²Å¦X±ø¥óªºÀɦW
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 4# Hsieh


    §¹¥þ¤F¸Ñ   ·PÁ Hseih ¶W¯Åª©¥D

TOP

        ÀR«ä¦Û¦b : ¥@¤W¦³¨â¥ó¨Æ¤£¯àµ¥¡G¤@¡B§µ¶¶ ¤G¡B¦æµ½¡C
ªð¦^¦Cªí ¤W¤@¥DÃD