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

[µo°Ý] ¼Ï¯Ã¤ÀªRªí§ó·s¸ê®Æ¨Ó·½»P­«·s¾ã²z°ÝÃD

[µo°Ý] ¼Ï¯Ã¤ÀªRªí§ó·s¸ê®Æ¨Ó·½»P­«·s¾ã²z°ÝÃD

¦]¬°¨C¤Ñ©Ò¬Ý¨ìªº³øªí¤º®e³£¤@¼Ë¡A¥u¦³¨Ó·½¸ê®Æ·|ÅÜ°Ê¡A©Ò¥H·Q»¡³z¹L½Æ»s¼Ï¯Ã¤ÀªRªíªº¤è¦¡¶i¦æ
¬ÛÃöµ{¦¡½X¦p¤U:
        Workbooks.Sheets("Analysis Table").PivotTables("WIP").ChangePivotCache _
        Workbooks.PivotCaches.create(xlDatabase, wo.Sheets("TotalWIP").UsedRange.Address)
        Workbooks.RefreshAll
        Workbooks.Close (True)

        PivotCache.Refresh
        RefreshTable
        RefreshAll
³o¤TºØ¤è¦¡³£¹Á¸Õ¹L¤F¡A¤]³]©w¹LÀɮ׶}°_­«·s¾ã²zªº¤è¦¡¡A¦ý¬O¶}±ÒÀɮ׫á¡A­n®i¶}¼Ï¯Ã¤ÀªRªíªº¸ê®Æ®É«h·|Åã¥Ü
"Àx¦sªº¼Ï¯Ã¤ÀªRªí¨S¦³¸ê®Æ¡C½Ð¥Î[§ó·s¸ê®Æ]©R¥O¨Ó§ó·s¼Ï¯Ã¤ÀªRªí¡C" ĵ§iµe­±
¤â°Ê°õ¦æ­«·s¾ã²z«á´N·|¥¿±`¤F¡C

·Q½Ð°ÝÁÙ¦³­þºØ¤è¦¡¥i¥HÁקK¦¹ª¬ªp¡C

¦^´_ 1# joime
Workbooks ¬O¶°¦X¡A¨S¦³Workbooks.Sheets  ³oºØ¼gªk¡C

³z¹L½Æ»s¼Ï¯Ã¤ÀªRªí??
³Ì¦nªþ¤WÀɮ׬ݬݡC
ªí¹F¤£²M¡BÃD·N¤£©ú½T¡B¨SªþÀɮ׮榡¡B¨S¦³°Q½×°ÝÃDªººA«×~~~~~~¥H¤W·R²ö¯à§U¡C

TOP

¥»©«³Ì«á¥Ñ joime ©ó 2015-11-26 15:22 ½s¿è

©êºp§Ú­«·sªí¹F§Úªº°ÝÃD¡A¥D­n¦]¬°¼Ï¯Ã¤ÀªRªí­n©ÔªºÄæ¦ì«Ü¦h¡A¦]¦¹·Q»¡¯à§_³z¹L½Æ»sªº¤è¦¡¡A
¢Ï¤u§@ï¤w¸g¦³¼Ï¯Ã¤ÀªRªí»Pªº¸ê®Æ¨Ó·½¡A¢Ð¤u§@靈·sªº¸ê®Æ¨Ó·½¡A
¦]¦¹·Q±N¢Ï¤u§@諸¼Ï¯Ã¤ÀªRªísheet½Æ»s¨ì¢Ð¤u§@鷺¡A¨Ã­×§ï¸ê®Æ¨Ó·½¬°¢Ð¤u§@諸·s¸ê®Æ¨Ó·½
Àɮ׳¡¤À¥Ñ©ó¤½¥q¦³ÂêµÛ¥~ºô¡AµLªk¶ÇÀÉ
§¹¾ãµ{¦¡½X¦p¤U¡G
    Dim newDatapath As String
    Dim newDatawo As Workbook, vbawo As Workbook
   
    Application.ScreenUpdating = False
   
    newDatapath = "\Desktop\" & Format(Date, "yyyymm") & "\" & Format(Date, "yyyymmdd") & "WIP.xlsx"
   
    If Dir(newDatapath, vbDirectory) = "" Then
        MsgBox "½Ð½T»{newDataÀɮ׬O§_¤w¸g²£¥Í"
    Else
        Set newDatawo = Workbooks.Open(path)
        Set vbawo = ThisWorkbook
        
        '½Æ»s¼Ï¯Ã¤ÀªRªí
        vbawo.Sheets("Analysis Table").Copy after:=newDatawo.Sheets(newDatawo.Sheets.Count)
        
        'Åܧó¸ê®Æ¨Ó·½
        newDatawo.Sheets("Analysis Table").PivotTables("WIP").ChangePivotCache _
        newDatawo.PivotCaches.create(xlDatabase, wo.Sheets("TotalWIP").UsedRange.Address, xlPivotTableVersion15)
        
        '­«·s¾ã²z
        newDatawo.RefreshAll
        
        'Ãö³¬ÀɮרÃÀx¦s
        newDatawo.Close (True)
    End If
   
    Set newDatawo = Nothing
    Set vbawo = Nothing
   
    Application.ScreenUpdating = True

°õ¦æµ²ªG¦³¦¨¥\¼Ï¯Ã¤ÀªRªí¨ì¢Ðªí¤¤¡A¦ý¬O®i¶}¼Ï¯Ã¤ÀªRªíªº¸ê®Æ®É¡A«h·|¸õ¥X»Ý­«·s¾ã²zµ¥´£¥Ü¡A
»Ý¤â°Ê°õ¦æ­«·s¾ã²z

TOP

        ÀR«ä¦Û¦b : ¤Hªº¤ß¦a¬O¤@²¥¥Ð¡A¤g¦a¨S¦³¼½¤U¦nºØ¤l¡A¤]ªø¤£¥X¦nªºªG¹ê¡C -
ªð¦^¦Cªí ¤W¤@¥DÃD