- ©«¤l
- 192
- ¥DÃD
- 15
- ºëµØ
- 0
- ¿n¤À
- 194
- ÂI¦W
- 0
- §@·~¨t²Î
- windows
- ³nÅ骩¥»
- office2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¤k
- µù¥U®É¶¡
- 2016-9-22
- ³Ì«áµn¿ý
- 2020-8-28
|
[µo°Ý] ·Q¦b즳ªºµ{¦¡½X¥[¤J§ä¬Q¤éªº¥\¯à
¥»©«³Ì«á¥Ñ starbox520 ©ó 2017-1-4 10:28 ½s¿è
¦¹µ{¦¡¥i¦b³o¸Ì¿é¤J¤é´Á(¬õ½u°é°_³¡¤À)
·|§äºô¬q¤W¸ê®Æ¡A¨Ì§Ú¿é¤Jªº¤é´Á¤§¶¡ªº©Ò¦³ªº¸ê®Æ
(¤¤¶¡¦³¤@¨Ç¤½¦¡°µpºâ)
¹³¤W¹Ï´N¬O·|¥h§ä5¤ë1¸¹-5¤ë31¸¹ªº¸ê®Æ
²{¦b·Q·s¼W¤@Óbotten¤£»Ý¿é¤J¤é´Á
«ö¤U·|ª½±µ¶]¬Q¤éªº¸ê®Æ¡AÁٽЫü¾É¤@¤U¡AÁÙ¦³³o°¦µ{¦¡¦³®ÉÔ·|¶]¨ì1¦~ªº¸ê®Æ
¬Û¹ïªº´N·|¶]¶W¤[¡K³Ì¤[¤@¦¸¶]¤F§Ö2¤Ñ= ="¡Aµ{¦¡½X³¡¤À¦³¿ìªkÀu¤Æ¶Ü- Sub Sumbit()
- clean_rawdata
- Sheets("Act_UTZ").Select
- Range("D4").Value = "¤â°Ê"
- Dim Src As String
-
-
- Application.DisplayAlerts = False
-
-
- Src = ThisWorkbook.Name
-
- start_year = Left(Worksheets("Main").Cells(2, 2), 4)
- end_year = Left(Worksheets("Main").Cells(2, 4), 4)
-
- start_month = Mid(Worksheets("Main").Cells(2, 2), 5, 2)
- end_month = Mid(Worksheets("Main").Cells(2, 4), 5, 2)
-
- start_day = Right(Worksheets("Main").Cells(2, 2), 2)
- end_day = Right(Worksheets("Main").Cells(2, 4), 2)
-
- start_date = Right(Worksheets("Main").Cells(2, 2), 4)
- end_date = Right(Worksheets("Main").Cells(2, 4), 4)
-
-
- ''''plan_period¬°©Òn¤U¸ü¤§PC Planª©¥»¤é´Á
-
-
- If Val(end_month) > Val(start_month) Or Val(end_year) > Val(start_year) Then
-
- If start_month = "01" Or start_month = "03" Or start_month = "05" Or start_month = "07" Or start_month = "08" Or start_month = "10" Or start_month = "12" Then
- m1 = 31
- End If
- If start_month = "02" Then
- m1 = 29
- End If
- If start_month = "04" Or start_month = "06" Or start_month = "09" Or start_month = "11" Then
- m1 = 30
- End If
-
- plan_period = m1 - Val(start_day) + Val(end_day)
-
- End If
-
- If Val(end_month) = Val(start_month) Then
-
- If start_month = "01" Or start_month = "03" Or start_month = "05" Or start_month = "07" Or start_month = "08" Or start_month = "10" Or start_month = "12" Then
- m1 = 31
- End If
- If start_month = "02" Then
- m1 = 29
- End If
- If start_month = "04" Or start_month = "06" Or start_month = "09" Or start_month = "11" Then
- m1 = 30
- End If
-
- plan_period = Val(end_day) - Val(start_day)
-
- End If
-
-
- ' Worksheets("Raw_Data_1").Select
-
- 'Cells.Select
- ' Selection.EntireColumn.Hidden = False
- ' Worksheets("Raw_Data_1").AutoFilterMode = False
-
-
-
- For I = 0 To plan_period
-
- If Val(start_day) + I > m1 Then
-
- If Val(start_month) <= 8 Then
-
- month_var = "0" & Val(start_month) + 1
-
- ElseIf Val(start_month) >= 12 Then
-
- month_var = "0" & Val(start_month) + 1 - 12
-
- ElseIf Val(start_month) >= 9 Then
-
- month_var = Val(start_month) + 1
-
- End If
-
- If Val(start_day) + I - m1 <= 9 Then
-
- day_var = "0" & Val(start_day) + I - m1
-
- ElseIf Val(start_day) + I - m1 >= 10 Then
-
- day_var = Val(start_day) + I - m1
-
- End If
-
- plan_date = end_year & month_var & day_var
-
- End If
-
- '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
-
- If Val(start_day) + I <= m1 Then
-
- If Val(start_day) + I <= 9 Then
-
- day_var = "0" & Val(start_day) + I
-
- ElseIf Val(start_day) + I >= 10 Then
-
- day_var = Val(start_day) + I
-
- End If
-
- plan_date = start_year & start_month & day_var
-
- End If
-
-
- '¦b""¥i¿é¤Jºô§}
- Importfilepath = ""
-
- Set oldbook = Workbooks.Open(Importfilepath)
-
- 'Application.AutomationSecurity = secAutomation
-
-
-
- '-------------------------------------------------------------------------------------------------------------------
-
- Columns("A:X").Select
- Selection.Copy
- Windows(Src).Activate
- Sheets("output").Select
- Range("A1").Select
- Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
- :=False, Transpose:=False
-
- Range("X2").Select
- Application.CutCopyMode = False
- ActiveCell.FormulaR1C1 = "=RC[-15]&RC[-20]"
- Range("X2").Select
- With Selection.Interior
- .Pattern = xlSolid
- .PatternColorIndex = xlAutomatic
- .ThemeColor = xlThemeColorLight2
- .TintAndShade = 0.799981688894314
- .PatternTintAndShade = 0
- End With
- Range("X1").Select
- ActiveCell.FormulaR1C1 = "$"
-
-
- '¤U©Ô
- Dim r1 As Range
- Range("A1").Select
- Selection.End(xlDown).Select
-
- rf = ActiveCell.Offset(0, 23).Address
- rtxt = "x2:" & rf
- Set r1 = Range(rtxt)
- r1.Select
- Selection.FillDown
-
- 'ȶK¤W
- Selection.Copy
- Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
- :=False, Transpose:=False
- ¤½¦¡_UTZ
- ¶K¤W
- '¨ê¤l
-
-
- Windows("Tester_COEE&UTZ_" & plan_date & "_DailyRawData.xls").Activate
- Workbooks("Tester_COEE&UTZ_" & plan_date & "_DailyRawData.xls").Close False
-
-
-
- Next
-
- MsgBox ("¤â°Ê©Ô¤é´Á")
-
-
- End Sub
½Æ»s¥N½X
¥i§ì¨úºô¬q¤W¸ê®Æ.rar (227.96 KB)
|
|