Ãö©ó vba¤U¸ü«á ¥L¤£¬Oªí®æªº¤è¦¡ ½Ð°Ý¬Oþ¸Ì¿ù¤F
- ©«¤l
- 78
- ¥DÃD
- 30
- ºëµØ
- 0
- ¿n¤À
- 109
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- XP
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2014-5-15
- ³Ì«áµn¿ý
- 2018-9-16
|
Ãö©ó vba¤U¸ü«á ¥L¤£¬Oªí®æªº¤è¦¡ ½Ð°Ý¬Oþ¸Ì¿ù¤F
¤j¤jÌ
½Ð°Ý¤@¤U
§Ú°µ¤F¤@Ó§ì¸ê®Æªºvba
¦ý³oÃä©Ç©Çªº ½Ð°Ý¬Oþ¸Ì¿ù¤F¶Ü¡H
À³¸Ó¬O ·|Åܦ¨ªí®æ«ç»ò·|Åܦ¨¹Ï¤ùªº¼Ë¤l
·PÁ¤j¤j«ü±Ð
Sub §ó·s¤W¥«¦ÛÀç°Ó()
'
' ¥¨¶°1 ¥¨¶°
' ÂI¿ï¤W¥«¤À¶ ¦A¨ì²M°£¤W¥«¿Ä¸ê ¦A¦^¨ì ¤W¥«½Æ»s¤é´Á ¶K¦^¤W¥«¿Ä¸ê -->°õ¦æÀɮפU¸ü
'
'
Sheets("¤W¥«").Select
Range("B1").Select
Sheets("¤W¥«¦ÛÀç°Ó").Select
Cells.Select
Selection.ClearContents
Sheets("¤W¥«").Select
Selection.Copy
Sheets("¤W¥«¦ÛÀç°Ó").Select
Range("A1").Select
ActiveSheet.Paste
Dim A As Date
Dim Rep_Ym As String
Dim Rep_Day As String
A = Range("A1").Value
Rep_Ym = Format(A, "yyyyMM")
Rep_Day = Format(A, "yyyyMMDD")
With ActiveSheet
If .QueryTables.Count = 0 Then
With .QueryTables.Add("URL;about:Tabs", .[B1])
.Refresh BackgroundQuery:=False
End With
End If
With .QueryTables(1)
'¥þ³¡¤U¸ü¤[¤@ÂI
.Connection = "URL;http://www.twse.com.tw/ch/trading/fund/T86/print.php?edition=ch&filename=genpage/" & Rep_Ym & "/" & Rep_Day & "_2by_issue.dat&type=csv&select2=ALLBUT0999&qdate=" & Rep_Day & ""
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "10"
'³o¥þ³¡ªºn¥Î .WebTables = "10"
'¨ä¥L¶µ¥Øªºn¥Î .WebTables = "8"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End With
End Sub |
|
|
|
|
|
|