- ©«¤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
        
|
¥»©«³Ì«á¥Ñ GBKEE ©ó 2011-5-4 09:15 ½s¿è
¦^´_ 4# carzyindex
½Ð@¤ßµ¥Ô µ{¦¡¦b¶]®É **½Ð¤Å«ö¤U** [½T©w]
'¦¹ºô¶¦³¤U¸üºÞ¨î ¶·¦³¤U¸ü®É¶¡¶¡¹j 3¬í ¥i¥þ³¡¤U¸ü§¹¦¨
A = CreateObject("WScript.Shell").popup("½Ðµ¥«Ý4¬í«á¤U¸ü" & Chr(10) & Chr(10) & "** ½Ð¤Å«ö¤U ** [½T©w]", 3, ¤é´Á & "_" & .[F2] & " ²Ä" & i & "¶", 16 * 3 + 0)- 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 |
|