- ©«¤l
- 87
- ¥DÃD
- 24
- ºëµØ
- 0
- ¿n¤À
- 122
- ÂI¦W
- 0
- §@·~¨t²Î
- win 7
- ³nÅ骩¥»
- 2016
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-7-9
- ³Ì«áµn¿ý
- 2018-1-16
|
¥»©«³Ì«á¥Ñ play9091 ©ó 2011-7-21 09:43 ½s¿è
¤p§Ì¼g¤F¤@ÓVBA¨Ó¸Ñ¨M¡A¨C¤Ñn°µ¤T¤p®É³ø§iªºÊ¨¹Ò¡K¡Kªá¤F¤G¤Ñªº®É¶¡§â¥¦§Ë§¹¤F¡A¦ý¬O¥¦«D±`ªº¥¨¤j¡A¦Ó¤p§Ì¥\¤O©|²L¡A§ä¤£¨ìÀu¤Æªº¤âÂ_¡A·Q½Ð¯q¤@¤Uª©¤Wªº¥ý¶iÌÀ°§U¤@¤U¡I¡I¡I- Sub name_test()
- Application.ScreenUpdating = False
- Application.DisplayAlerts = False
- T = Time
- For I = 4 To 10
- '¥s¥XKPI³ø§i
- KPI = InputBox("C#KPI³ø§i¸ôÍß(¶¶§Ç±qC4¡ãC9¡A³Ì«á¤~¬OC1)")
- Workbooks.Open (KPI)
- Set KPI = Nothing
- KPI = ActiveWorkbook.Name
- '¥s¥X¨C¤éC#³ø§i
- Clu = InputBox("C#³ø§i¸ôÍß(¶¶§Ç±qC4¡ãC9¡A³Ì«á¤~¬OC1)")
- Workbooks.Open (Clu)
- Set Clu = Nothing
- Clu = ActiveWorkbook.Name
- '½Æ¨î¨C¤éC#³ø§iªºsheet¨ìKPI³ø§i
- If I <> 10 Then
- Workbooks(Clu).Sheets("sheet1").Copy After:=Workbooks(KPI).Sheets("M2000 BSC KPI Report (2)")
- Sheets("sheet1").Name = "C" & I
- ElseIf I = 10 Then
- Workbooks(Clu).Sheets("sheet1").Copy After:=Workbooks(KPI).Sheets("sheet5")
- Sheets("Sheet1 (2)").Name = "C" & I
- End If
- Workbooks(Clu).Close SaveChanges:=False
- Set Clu = Nothing
- '¥s¥Xpaging³ø§i
- Pag = InputBox("paging³ø§i¸ôÍß")
- Workbooks.Open (Pag)
- Set Pag = Nothing
- Pag = ActiveWorkbook.Name
- '½Æ¨îpaging³ø§iªºsheet¨ìKPI³ø§i
- If I <> 10 Then
- Workbooks(Pag).Sheets("sheet1").Copy After:=Workbooks(KPI).Sheets("M2000 BSC KPI Report (2)")
- Sheets("sheet1").Name = "paging"
- ElseIf I = 10 Then
- Workbooks(Pag).Sheets("sheet1").Copy After:=Workbooks(KPI).Sheets("sheet2")
- Sheets("Sheet1 (2)").Name = "paging"
- End If
- Workbooks(Pag).Close SaveChanges:=False
- Set Pag = Nothing
- '¶}©l¥X³ø§i
- Sheets("paging").Select
- Range("A11").Select
- Range(Selection, Selection.End(xlToRight)).Select
- Range(Selection, Selection.End(xlDown)).Select
- Selection.Copy
- If I <> 10 Then
- Sheets("M2000 MSC Paging").Select
- ElseIf I = 10 Then
- Sheets("sheet5").Select
- End If
- Range("A2").Select
- Range(Selection, Selection.End(xlToRight)).Select
- Range(Selection, Selection.End(xlDown)).Select
- ActiveSheet.Paste
- '²M°£°Å¶KÁ¡
- ' My.Computer.Clipboard.Clear() = True
- Sheets("C" & I).Select
- Range("A11").Select
- Range(Selection, Selection.End(xlToRight)).Select
- Range(Selection, Selection.End(xlDown)).Select
- Application.CutCopyMode = False
- Selection.Copy
- If I <> 10 Then
- Sheets("M2000 BSC KPI Report").Select
- Range("A3").Select
- ElseIf I = 10 Then
- Sheets("sheet2").Select
- Range("A2").Select
- End If
- Range(Selection, Selection.End(xlToRight)).Select
- Range(Selection, Selection.End(xlDown)).Select
- ActiveSheet.Paste
- If I <> 10 Then
- '²M°£°Å¶KÁ¡
- ' My.Computer.Clipboard.Clear() = True
- Sheets("C" & I).Select
- Application.CutCopyMode = False
- Sheets("C" & I).Range("E3").Value = "=IF(ISLOGICAL(E4)," & "" & ",A10)"
- Sheets("C" & I).Range("F3").Value = "=IF(ISLOGICAL(F4)," & "" & ",A10)"
- Sheets("C" & I).Range("E4").Value = "=Text(Right(A11, 8), ""hh:mm:ss"") >= ""02:00:00"""
- Sheets("C" & I).Range("F4").Value = "=Text(Right(A11, 8), ""hh:mm:ss"") <= ""21:30:00"""
- Range("A11").Select
- Range(Selection, Selection.End(xlToRight)).Select
- Range(Selection, Selection.End(xlDown)).Select
- Range("A10:EQ5482").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= _
- Range("E3:F4"), Unique:=False
- Selection.Copy
- Sheets("M2000 BSC KPI Report (2)").Select
- Range("A3").Select
- Range(Selection, Selection.End(xlToRight)).Select
- Range(Selection, Selection.End(xlDown)).Select
- ActiveSheet.Paste
- End If
- Sheets("C" & I).Delete
- Sheets("paging").Delete
- D = InputBox("¿é¤J¤µ¤Ñªº¤é´Á(EX¡G16)")
- If I <> 10 Then
- Sheets("sheet2").Select
- ElseIf I = 10 Then
- Sheets("BSC23-43 BTS Track").Select
- End If
- Cells.Replace What:=D - 1, Replacement:=D, LookAt:=xlPart, SearchOrder _
- :=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
- Workbooks(KPI).Close SaveChanges:=True
- Set KPI = Nothing
- Next I
- MsgBox ("¦@¥Î®É: " & Format(Time - T, "HH:MM:SS"))
- End Sub
½Æ»s¥N½X |
|