- ©«¤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
|
¦^´_ 4# lman
µ{¦¡½X¤º®e¨S¦³¶×¤J¸ê®Æ¦s©ñªºÀx¦s®æ
¬°¦ó©ñA3¥i¥H¦Û°Ê§ó·s
¦]¬°µ{¦¡®M¤W§AªþÀɤu§@ªí¤¤¤w¦³¤@Ó¥~³¡¸ê®Æ¨Ó·½©Ò¶Ç¦^¤§¸ê®Æªº¬d¸ßªí ¨Ã«ü©w¤Fºô§}
¥un¨S¦³§R°£³o¬d¸ßªí °õ¦æµ{¦¡ ´N·|§ó·s¸ê®Æ
With ActiveSheet.QueryTables(1) '¥Nªí«ü©w¤u§@ªí¤¤¥~³¡¸ê®Æ¨Ó·½©Ò¶Ç¦^¤§¸ê®Æªº²Ä¤@Ó¬d¸ßªí
.Connection = _
"URL;http://www.twse.com.tw/ch/trading/exchange/MI_INDEX/genpage/Report" & Format(ActiveSheet.[A1], "YYYYMM") & "/A112" & Format(ActiveSheet.[A1], "YYYYMMDD") & "MS.php?select2=MS&chk_date=" & Format(ActiveSheet.[A1], "EE/MM/DD") '¬d¸ßªíªººô§}
¦pªG¬O«ü©w¶×¤J¸ê®Æ¦s©ñªºÀx¦s®æ
- Sub Ex()
- Dim Rng As Range, OldRng$
- Set Rng = ActiveSheet.[J1] '«ü©w·sªº¦ì§} ¥B¤w«ü©w¤é´Á
- On Error GoTo QueryTablesAdd
- With Rng.QueryTable
- .Connection = _
- "URL;http://www.twse.com.tw/ch/trading/exchange/MI_INDEX/genpage/Report" & Format(Rng, "YYYYMM") & "/A112" & Format(Rng, "YYYYMMDD") & "MS.php?select2=MS&chk_date=" & Format(Rng, "EE/MM/DD")
- .WebSelectionType = xlSpecifiedTables
- .WebFormatting = xlWebFormattingNone
- .WebTables = "8"
- .WebPreFormattedTextToColumns = True
- .WebConsecutiveDelimitersAsOne = True
- .WebSingleBlockTextImport = False
- .WebDisableDateRecognition = False
- .WebDisableRedirections = False
- .Refresh BackgroundQuery:=False
- End With
- End
- QueryTablesAdd:
- OldRng = Rng.Value
- Rng.Value = ""
- With ActiveSheet.QueryTables.Add(Connection:= _
- "URL;http://www.twse.com.tw/ch/trading/exchange/MI_INDEX/genpage/Report201007/A11220100723MS.php?select2=MS&chk_date=99/07/23", Destination:=Rng)
- .Name = "¤j½L²Îp¸ê°T"
- .WebTables = "8"
- .Refresh BackgroundQuery:=False
- .ResultRange.ClearFormats
- End With
- Rng.Value = OldRng
- Resume
- End Sub
½Æ»s¥N½X |
|