¥»©«³Ì«á¥Ñ 52ee24 ©ó 2015-12-31 08:52 ½s¿è
¦U¦ì¤j¤j½Ð°Ý¤@¤U
§Ú·Q§â¨C¤Ñ¾ã²zªº¸ê®Æ³]«öÁä¦Û°Ê§ó·s¨ì·í¤ë¸ê®Æªº³Ì¤U±¤@¦C
·QÁקK¦pªG¤£¤p¤ß«ö¨ì´N¤S§â¸ê®Æ¦A¶K¤@¦¸
¦ý§PÂ_ªº¤è¦¡¦n¹³¤£¹ï
½Ð¦U¦ìÀ°¦£¬Ý¬Ý¨º¿ù¤F
ÁÂÁÂ
Sub MTD()
Dim a, b, c, today
today = InputBox("¿é¤J§ó·s¤é´Á¨Ò:yyyy/mm/dd")
a = Worksheets("Brick¸ê®Æ®w_1¦¸IR").Range("a2").CurrentRegion.Rows.Count
b = Worksheets("Brick¸ê®Æ®w_1¦¸IR").Range("a2").CurrentRegion.Columns.Count
c = Worksheets("Brick¸ê®Æ®w_1¦¸IR-MTD").Range("a1").CurrentRegion.Rows.Count
Worksheets("Brick¸ê®Æ®w_1¦¸IR").Select
'¬Ý¸ê®Æ¦³µL«½Æ¶K
If Worksheets("Brick¸ê®Æ®w_1¦¸IR-MTD").Range("a:a") = today Then
MsgBox ("§ó·s¹L¤F")
Else: Range(Cells(2, 1), Cells(a, b)).Copy Worksheets("Brick¸ê®Æ®w_1¦¸IR-MTD").Range("a" & c + 1)
End If
'¼Ï¯Ã
Worksheets("Brick¸ê®Æ®w_1¦¸IR-MTD").Select
Dim FF As Range
Set FF = Worksheets("Brick¸ê®Æ®w_1¦¸IR-MTD").Range(Cells(1, 1), Cells(c + a - 1, b))
Sheets("¥¢±Ñ²v").Select
'MTD
Range("b107").Select
ActiveSheet.PivotTableWizard SourceType:=xlDatabase, SourceData:=FF
ActiveSheet.PivotTables("¥¢±Ñ²v-MTD").PivotCache.Refresh
Sheets("¥¢±Ñ²v").Select
MsgBox ("MTD-¾ã²z§¹¦¨") |