- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¦^´_ 12# carzyindex
¤U¸ü¤@¤äªÑ²¼n±Nªñ10¤ÀÄÁ , §Ú¨S´ú¸Õ§¹,½Ð§AºCºC´ú¸Õ .- Option Explicit
- Sub ©ú²Ó¤U¸ü()
- Dim ªÑ²¼¥N¸¹ As Range, ¤é´Á As Variant, i As Integer, A, T As Date
- Dim Rng As Range
- Do While Not IsDate(¤é´Á)
- ¤é´Á = InputBox("¿é¤J¬d¸ß¤é´Á", "¤é´Á", Date)
- If ¤é´Á = "" Then End
- Loop
- ¤é´Á = Format(¤é´Á, "yyyymmdd")
- Set ªÑ²¼¥N¸¹ = Workbooks("TEST.XLSX").Sheets("sheet2").[A1]
- Do While ªÑ²¼¥N¸¹.Value <> ""
- T = Time
- With Workbooks("TEST.XLSX").Sheets.Add(After:=Sheets(Sheets.Count))
- .Name = ¤é´Á & "-" & ªÑ²¼¥N¸¹ '³]¥ß ¦b¤u§@ªí¦WºÙ
- Application.StatusBar = False
- On Error GoTo A_Wait
- i = 1
- Do
- Set Rng = .Cells(Rows.Count, 1).End(xlUp).Offset(1)
- DoEvents
- With .QueryTables.Add(Connection:="URL;http://bsr.twse.com.tw/bshtm/bshtm_report_Messages.aspx?strDate=" & ¤é´Á & "&StartNumber=" & ªÑ²¼¥N¸¹ & "&FocusIndex=" & i, Destination:=Rng)
- .Name = ¤é´Á & "_" & ªÑ²¼¥N¸¹ & "_" & i
- .WebSelectionType = xlSpecifiedTables
- .WebFormatting = xlWebFormattingNone
- .WebTables = "6"
- .WebPreFormattedTextToColumns = True
- .WebConsecutiveDelimitersAsOne = True
- .WebSingleBlockTextImport = False
- .WebDisableDateRecognition = False
- .WebDisableRedirections = False
- ''''''µLªk¬d¸ß®Éµy«Ý ¨ì A_Wait: '''''
- .Refresh BackgroundQuery:=False
- If Application.CountA(.ResultRange) = 0 Then GoTo Out
- i = i + 1
- End With
- A = CreateObject("WScript.Shell").popup("½Ðµ¥«á¤U¸ü..." & Chr(10) & Chr(10) & "** ½Ð¤Å«ö¤U [½T©w] **", 4, ¤é´Á & "_" & ªÑ²¼¥N¸¹ & " ²Ä" & i & "¶", 16 * 3 + 0)
- Application.ScreenUpdating = True
- Loop
-
- Out:
- .UsedRange.Columns.AutoFit
- ''''''''§R°£ A,FÄ檺ªÅ®æ ''''''''''''''''''''''''''''''''
- .Range(.Cells(Rows.Count, "B").End(xlUp).Offset(1), .Cells(Rows.Count, "B")).Offset(, -1).Clear
- .Range(.Cells(Rows.Count, "G").End(xlUp).Offset(1), .Cells(Rows.Count, "G")).Offset(, -1).Clear
- '''''''''''''''''''''''''''''''''''''''
- A = CreateObject("WScript.Shell").popup("¦@¤U¸ü" & i & "¶", 5, ¤é´Á & "_" & ªÑ²¼¥N¸¹, 48 + 0)
- Application.StatusBar = ªÑ²¼¥N¸¹ & " ¦@¤U¸ü " & i & "¶ ¶O®É " & Format(Time - T, "HH:MM:SS")
- End With
- Set ªÑ²¼¥N¸¹ = ªÑ²¼¥N¸¹.Offset(1)
- Loop
- End
- A_Wait:
- Application.StatusBar = "µLªk¬d¸ßµ¥Ô10¬íÄÁ" 'ºô¶Ác¦£®Éµ{¦¡·|¦³¿ù»~
- Application.Wait Now + TimeValue("00:00:10") '¥i¼W¥[µ¥Ô¬d¸ßªº¬í¼Æ
- Err.Clear
- Application.StatusBar = False
- Resume '«ªð¬d¸ß
- End Sub
½Æ»s¥N½X |
|