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

[µo°Ý] ¦Û°Ê²£¥Í¸ê®Æ§¨

¦^´_ 1# PJChen
¸Õ¸Õ¬Ý
  1. Sub Ex()
  2. Set fdo = CreateObject("Scripting.FilesystemObject")
  3. With Workbooks.Open("P:\PJ-Home\NEDoc.xlsx")
  4.     With .Sheets("INV")
  5.        fs = Right(.[S8], 5) & "_" & .[Q8] & "_" & .[I8]
  6.        fd = "P:\Shipping Doc\NE-Logistics\" & fs
  7.        k = fdo.folderexists(fd)
  8.        ar = Split(fd, "\")
  9.        fn = ar(0)
  10.        For i = 1 To UBound(ar)
  11.        fn = fn & "\" & ar(i)
  12.           If fdo.folderexists(fn) = False Then fdo.createfolder fn
  13.        Next
  14.     End With
  15.     .SaveCopyAs fd & "\" & fs & ".xlsx"
  16.     .Close
  17. End With
  18. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 5# PJChen

1)  ExcelªºÀɮצWºÙ­n¥Î¥H¤Uªº¤è¦¡¦sÀÉ,½Ð°Ý¸Ó«ç»ò­×§ïµ{¦¡? (¨Ò:§Y:CI12-182_PO#4500055767)
       ²£¥Í¸ê®Æ§¨«á,­n­ì¥»ªº"NEDoc"¥HÀx¦s®æI8_PO#S8¥t¦s¤@­Ó·sªºÀɮצWºÙ(§Y:CI12-182_PO#4500055767)¸m©ó¸ê®Æ§¨"55767_TE_CI12-182"¤¤
ANS1:³o¥u¬OÀɦW³W«h°ÝÃD¡A­ì¥»fs = Right(.[S8], 5) & "_" & .[Q8] & "_" & .[I8]ÀɦW·|¬O55767_TE_CI12-182
           fs = .[I8] & "-PO#" & "_" & .[S8]ÀɦW´N¬OCI12-182_PO#4500055767

2)  §Ú­Y·Q±NNEDoc¥´¶}«á(¦]¦³®ÉÁÙ­n­×§ï¤å¥ó)¦A°õ¦æ¤W­zªº¥¨¶°,½Ð°Ý­n¦p¦ó§ï? ¬O§_§ï¥H¤Uªºµ{¦¡:With Workbooks.Open("P:\PJ-Home\NEDoc.xlsx")
       §ï¦¨ With Workbooks("P:\PJ-Home\NEDoc.xlsx") ,¦ý¥¦¤£¯à°õ¦æ,½Ð°Ý°ÝÃD¥X¦b­þ¸Ì?
ANS2:Àɮפw¸g¶}±Òª¬ºA¥u»Ý¨Ï¥Îµøµ¡ªºCaption«ü©w¡A§ï¦¨With Windows("NEDoc.xlsx") §Y¥i¡C

3)  ­Y­ì"NEDoc"¤å¥óªº¦s©ñ¦ì¸m¤ÎÀɦW¬°P:\PJ-Home\NEDoc,¦b°õ¦æ«á§Ú¤£·QÂл\­ìÀɦW,
       ¥u­n¥¦°õ¦æ«áÀx¦s¦b·s¸ê®Æ§¨¦WºÙ¤Î¸ô®|¬°P:\Shipping Doc\NE-Logistics\55767_TE_CI12-182¤¤,¤S¸Ó§ó§ï­þ­Ó³¡¥÷?
ANS3:¦P¥Ø¿ý¤U¤£¥i¦³­«½ÆÀɦW¡A©Ò¥H³o³¡¤ÀµLªk¤F¸Ñ§AªºÅÞ¿è¡C
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 8# PJChen
³oÃö¥G¨ì§Aªº¶}Àɰʧ@
°²³]µ{¦¡½X¬O¦bTEST.xlsmÀɮפº
¦pªG¥HTEST.xlsmªºµ{¦¡½X¶}±ÒNEDoc.xlsx
NEDoc.xlsx»Pµ{¦¡½X©Ò¦bªºÀɮ׬O¦P¤@­Ó±M®×(Application)¤Uªº2­Óµøµ¡
¨º»ò¡AWith Windows("NEDoc.xlsx")À³¸Ó¥i¥H°õ¦æ
¦pªG¡ANEDoc.xlsx¬O¥H¤â°Ê¶}±Ò«á°µ­×§ï
¨º»ò­n¬Ý§AªºTEST.xlsm¶}±Ò«á¬O¨â­ÓEXCEL±M®×©Î¬O¦P¤@­Ó±M®×
¦pªG¦P¤@­Ó±M®×With Workbooks("NEDoc.xlsx")À³¥i¦¨¥ß
­Y«D¦P¤@­Ó±M®×¨º»òµ{¦¡½X¨ÃµLªk¸ó±M®×¨ú±oEXCELªº¬¡­¶Ã¯ª«¥ó
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

        ÀR«ä¦Û¦b : Ãø¦æ¯à¦æ¡AÃø±Ë¯à±Ë¡AÃø¬°¯à¬°¡A¤~¯àª@µØ¦Û§Úªº¤H®æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD