- ©«¤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 ©ó 2013-9-19 20:58 ½s¿è
¦^´_ 73# pupai
¸Õ¸Õ¬Ý- Option Explicit
- Private Sub ¤j½L¦¨¥æ¸ê°T()
- Dim xlTheYear As String, xlTheMonth As String, STK_NO As String, xlTheFile As String, AR
- Dim Sh As Worksheet
- xlTheYear = Format(Range("C1"), "0000") 'קï¦r¦ê®æ¦¡
- xlTheMonth = Format(Range("C2"), "00") 'קï¦r¦ê®æ¦¡
- STK_NO = Format(Range("C3"), "0000") 'קï¦r¦ê®æ¦¡
- Set Sh = ThisWorkbook.Sheets.Add '·s¼W¤u§@ªí
- Sh.Name = xlTheYear & "_" & xlTheMonth '·s¼W¤u§@ªí©R¦W
- '******http://www.twse.com.tw/ch/trading/exchange/FMTQIK/FMTQIK2.php*****
- 'xlTheFile = "http://www.twse.com.tw/ch/trading/exchange/FMTQIK/FMTQIK2.php?STK_NO=" & STK_NO & "&myear=" & xlTheYear & "&mmon=" & xlTheMonth & "&type=csv"
-
- '******http://www.twse.com.tw/ch/trading/exchange/BWIBBU/BWIBBU.php*****
- xlTheFile = "http://www.twse.com.tw/ch/trading/exchange/BWIBBU/BWIBBU.php?STK_NO=" & STK_NO & "&myear=" & xlTheYear & "&mmon=" & xlTheMonth
- '**************************************************************
- With Workbooks.Open(xlTheFile)
- If InStr(xlTheFile, "BWIBBU") Then
- AR = .Sheets(1).Range("b446").CurrentRegion 'http://www.twse.com.tw/ch/trading/exchange/BWIBBU/BWIBBU.php
- Else
- .Sheets(1).UsedRange.Copy Sh.[A1]
- End If
- .Close 0
- End With
- With Sh
- If InStr(xlTheFile, "BWIBBU") Then .Range("A1").Resize(UBound(AR, 1), UBound(AR, 2)) = AR
- .Cells.EntireColumn.AutoFit '½Õ¾ãÄæ¼e
- .Columns("A:A").ColumnWidth = 28.56
- End With
- End Sub
½Æ»s¥N½X |
|