- ©«¤l
- 24
- ¥DÃD
- 2
- ºëµØ
- 0
- ¿n¤À
- 32
- ÂI¦W
- 0
- §@·~¨t²Î
- WINDOW XP
- ³nÅ骩¥»
- OFFICE 2003
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-10-31
- ³Ì«áµn¿ý
- 2018-1-17
|
¥æ©ö©ú²Ó¤U¸ü
http://bsr.twse.com.tw/bshtm/
³oÓºô¯¸¤ñ¸û¦³¤H©Ê¤@ÂI °Ñ¼Æ§äªº¨ì¤]¥i¥H³]©w
¦ý¬O§Ú¤£ª¾¹D¶¼Æ¦³´X±i
¤gªk·Ò¿û¤@¶¤@¶§Ë¤]«Ü¨S¦³®Ä²v
¬d¸ß¤Ó¦h¦¸ÁÙ·|³QÀÉ
½Ð°Ýµ{¦¡¸Ó¦p¦ó¤U¸ü- Sub Ӫѥæ©ö©ú²Ó¤U¸ü()
- Dim ªÑ²¼¥N¸¹ As String, ¤é´Á As Variant, N, i As Integer, A, T As Date
- Do While Not IsDate(¤é´Á)
- ¤é´Á = InputBox("¿é¤J¬d¸ß¤é´Á", "¤é´Á", Date)
- If ¤é´Á = "" Then End
- Loop
- Do While ªÑ²¼¥N¸¹ = ""
- ªÑ²¼¥N¸¹ = InputBox("ªÑ²¼¥N¸¹", "¿é¤J¬d¸ß¤§ªÑ²¼¥N¸¹", "1101")
- If ¤é´Á = "" Then End
- Loop
- ¤é´Á = Format(¤é´Á, "yyyymmdd")
- T = Time
- With ActiveSheet
- For Each N In .Names
- N.Delete
- Next
- .Cells.Clear
- Application.StatusBar = False
- On Error GoTo A_Wait
- With .QueryTables.Add(Connection:="URL;http://bsr.twse.com.tw/bshtm/bshtm_report_Messages.aspx?strDate=" & ¤é´Á & "&StartNumber=" & ªÑ²¼¥N¸¹ & "&FocusIndex=1", Destination:=Range("A1"))
- .Name = ¤é´Á & "_" & ªÑ²¼¥N¸¹ & "_1"
- .FieldNames = True
- .RowNumbers = False
- .FillAdjacentFormulas = False
- .PreserveFormatting = True
- .RefreshOnFileOpen = False
- .BackgroundQuery = True
- .RefreshStyle = xlInsertDeleteCells
- .SavePassword = False
- .SaveData = True
- .AdjustColumnWidth = True
- .RefreshPeriod = 0
- .WebSelectionType = xlEntirePage
- .WebFormatting = xlWebFormattingNone
- .WebPreFormattedTextToColumns = True
- .WebConsecutiveDelimitersAsOne = True
- .WebSingleBlockTextImport = False
- .WebDisableDateRecognition = False
- .WebDisableRedirections = False
- .Refresh BackgroundQuery:=False
- If Application.CountA(.ResultRange) = 0 Then
- MsgBox Format(¤é´Á, "0000/00/00") & " ¥ð¥«!!! ©Î ªÑ²¼¥N¸¹:" & ªÑ²¼¥N¸¹ & " ¿ù»~ !!!"
- [A1].Select
- End
- End If
- End With
- i = 2
- Do
- .Cells(Rows.Count, 1).End(xlUp).Offset(1).Select
- With .QueryTables.Add(Connection:="URL;http://bsr.twse.com.tw/bshtm/bshtm_report_Messages.aspx?strDate=" & ¤é´Á & "&StartNumber=" & ªÑ²¼¥N¸¹ & "&FocusIndex=" & i, Destination:=Selection)
- .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, ¤é´Á & "_" & .[F2] & " ²Ä" & i & "¶", 16 * 3 + 0)
- Application.ScreenUpdating = True
- Loop
- Out:
- .UsedRange.Columns.AutoFit
- .[A1].Select
- A = CreateObject("WScript.Shell").popup("¦@¤U¸ü" & i & "¶", 5, ¤é´Á & "_" & ªÑ²¼¥N¸¹, 48 + 0)
- Application.StatusBar = "¦@¤U¸ü " & i & "¶ ¶O®É " & Format(Time - T, "HH:MM:SS")
- End With
- End
- A_Wait:
- Application.StatusBar = "µLªk¬d¸ßµ¥Ô10¬íÄÁ"
- Application.Wait Now + TimeValue("00:00:10")
- Err.Clear
- Application.StatusBar = False
- Resume '«ªð¬d¸ß
- End Sub
½Æ»s¥N½X ¥H«e¥i¥H¤U¸ü¨ì...²{¦b¤U¤£¨ì¡A½Ð¨D°ª¤â¸Ñ´b |
|