- ©«¤l
- 96
- ¥DÃD
- 18
- ºëµØ
- 0
- ¿n¤À
- 125
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2014-3-23
- ³Ì«áµn¿ý
- 2022-8-2
|
¦^´_ 23# GBKEE
GBKEEª©¥D±z¦n¡A±N±zªºµ{¦¡½X®M¤J¤§«á¬O¥i¥H±N1420¸õ¹L¤£§ì¸ê®Æ¤F¡A¤£¹L¦]¬°1420¤]¬O¦b°j°éÅܼÆEªº¨ä¤¤¤@½X¡A¬O¤£¬OµLªk¥Î°j°é¤è¦¡¥hÁקK§ì¨ú¸ê®Æ
¥u¯à¤@Ó¤@Ó¹³³o¼Ë[If E = 1420 Then GoTo xlNext]³]©wÅý¥¦¸õ¹L©O¡H¦]¬°¹³³oºØªÑ²¼ÁÙ¯u¤£¤Ö¡An¤@Ó¤@Ó§ä¥X¨Ó¥i¯ànªá¨Ç¥\¤Ò
¥t¥~¹³³o¬q[If InStr(.[A3], "¬dµL") And Msg = True Or E = 2149 Then GoTo xlNext]·í¤¤ªº2149¬O¥Nªí¤°»ò©O¡H§Ú§âOr E = 2149®³±¼¦ü¥G¤£¼vÅTÂ^¨ú¸ê®Æ
³oÓºô¯¸ªº¸ê®Æ¥X²{"¬dµL"¬O¦bA2Àx¦s®æ¡A©Ò¥H§Ú§âA3§ï¦¨A2¡Aªþ¤Wµ{¦¡½X¡AÁÂÁ¡I- Option Explicit
- Sub §ì©u¤ëÀ禬¸ê®Æ()
- Dim E As Integer, URL As String, xPath As String, xFile As String
- Dim Msg As Boolean
- URL = "URL;https://djinfo.cathaysec.com.tw/Z/ZC/ZCH/ZCH.DJHTM?A="
- xPath = "G:\°]³ø¸ê®Æ"
- With ThisWorkbook
- With .Sheets(1) '¬¡¶Ã¯ªº²Ä 1 ±i¤u§@ªí
- If .QueryTables.Count = 0 Then
- With .QueryTables.Add(Connection:=URL, Destination:=.Range("$A$1"))
- .Refresh BackgroundQuery:=False
- End With
- End If
- Rows(1).Delete
- Columns(1).Delete
- For E = 1101 To 3000
- ER:
- With .QueryTables(1)
- .Connection = URL & E
- .PreserveFormatting = True
- .BackgroundQuery = True
- .RefreshStyle = xlInsertDeleteCells
- .SaveData = True
- .AdjustColumnWidth = True
- .RefreshPeriod = 0
- .WebSelectionType = xlSpecifiedTables
- .WebFormatting = xlWebFormattingNone
- .WebTables = "3"
- .WebPreFormattedTextToColumns = True
- .WebConsecutiveDelimitersAsOne = True
- .Refresh BackgroundQuery:=False
- End With
- If E = 1420 Then GoTo xlNext '¥[¤W¸Õ¸Õ¬Ý
- If InStr(.[A2], "¬dµL") And Msg = True Then GoTo xlNext
- If InStr(.[A2], "¬dµL") Then Msg = True: GoTo ER
- If InStr(.[A3], "ӪѥN½X¿ù»~") = False Then '³oºô¶¦pªÑ²¼¥N½X¿ù»~·|¶Ç¦^t¸¹.
- xFile = xPath & "\" & E & "\REVENUE.txt"
- MkDir_Sub xFile '10#ªºµ{¦¡ 'C¼Ñ¤Uªº©u·l¯qªí¸ê®Æ§¨¤£»Ý¥ý«Ø¥ß
- Maketxt xFile, .QueryTables(1)
- End If
- xlNext:
- Msg = False
- Next
- End With
- End With
- End Sub
½Æ»s¥N½X |
|