- ©«¤l
- 184
- ¥DÃD
- 45
- ºëµØ
- 0
- ¿n¤À
- 407
- ÂI¦W
- 0
- §@·~¨t²Î
- WIN 7
- ³nÅ骩¥»
- office 2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-8-19
- ³Ì«áµn¿ý
- 2024-11-1
|
[µo°Ý] ¦p¦ó¥i¥H«ü©w¤é´Á«á¤U¸ü¸ê®Æ
±z¦n
§Ú§Æ±æµ{¦¡¥i¥H¨Ì·Ó§Ú·Qnªº¤é´Á¤U¸ü·í¤Ñ¸ê®Æ
¥i¥HÀ°§Ú«ü¾Éקï
ÁÂÁÂ!!- Option Explicit
- Sub EX()
-
-
- Dim URL As String, xCo_Id As String, xSyear As String, xSseason As String
-
- xCo_Id = Range("B1").Value
- xSyear = Range("B2").Value
- xSseason = Range("B3").Value
-
- 'xCo_Id = "[" & """¦~«×""" & "," & """102¦~""" & "]"
- 'n¨D¿é¤Jºô¶ªº°Ñ¼Æ:¦~«×
- 'xSyear = "[" & """¤ë¥÷""" & "," & """¤ë """ & "]"
- 'Format(Date, "e")->¤¤µØ¥Á°êªº¤ë¥÷
- 'xSseason = "[" & """¤é""" & "," & """¤é´Á""" & "]"
- 'Format(Date, "q")->·í¦~«×ªº¤é´Á
-
- '¥~¸ê¤Î³°¸ê¶R½æ¶W·JÁ`ªí
- URL = "URL;http://www.twse.com.tw/ch/trading/fund/TWT38U/TWT38U.php?step=1&CO_ID=" & xCo_Id & "&SYEAR=" & xSyear & "&SSEASON=" & xSseason & "&REPORT_ID=C"
- With ActiveSheet.QueryTables.Add(Connection:=URL, Destination:=Range("D4"))
- .AdjustColumnWidth = False '¦Û°Ê½Õ¾ãÄæ¼e
- .WebSelectionType = xlSpecifiedTables
- .WebFormatting = xlWebFormattingNone
- .WebTables = "2"
- .WebPreFormattedTextToColumns = True
- .WebConsecutiveDelimitersAsOne = True
- .WebSingleBlockTextImport = False
- .WebDisableDateRecognition = False
- .WebDisableRedirections = False
- .Refresh BackgroundQuery:=False
- End With
- '§ë«H¶R½æ¶W·JÁ`ªí
- URL = "URL;http://www.twse.com.tw/ch/trading/fund/TWT44U/TWT44U.php?step=1&CO_ID=" & xCo_Id & "&SYEAR=" & xSyear & "&SSEASON=" & xSseason & "&REPORT_ID=C"
- With ActiveSheet.QueryTables.Add(Connection:=URL, Destination:=Range("K5"))
-
- .AdjustColumnWidth = False '¦Û°Ê½Õ¾ãÄæ¼e
- .WebSelectionType = xlSpecifiedTables
- .WebFormatting = xlWebFormattingNone
- .WebTables = "2"
- .WebPreFormattedTextToColumns = True
- .WebConsecutiveDelimitersAsOne = True
- .WebSingleBlockTextImport = False
- .WebDisableDateRecognition = False
- .WebDisableRedirections = False
- .Refresh BackgroundQuery:=False
-
- End With
-
- End Sub
½Æ»s¥N½X |
|