ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ½Ð°Ý³oºØ¶×¤J¥~³¡¸ê®Æweb­n¦p¦ó°µ¨ì

¥»©«³Ì«á¥Ñ GBKEE ©ó 2013-5-22 15:02 ½s¿è

¦^´_ 5# stillfish00
TextFileStartRow ¶·¬O¶×¤J¤å¦rÀÉ,³oºô­¶¤£¾A¥Î
¦^´_ 3# freeffly
¦^´_ 4# seemee
  1. Option Explicit
  2. Sub Ex()
  3.     With ActiveSheet
  4.         With .QueryTables.Add(Connection:="URL;http://www.taifex.com.tw/chinese/3/3_2_2.asp", Destination:=[A1])
  5.             '**********  .WebSelectionType     ¦³3­Ó°Ñ¼Æ¼Æ­È *************
  6.             If .Parent.QueryTables.Count = 1 Then
  7.                 .WebSelectionType = xlEntirePage                '¶×¤J¾ã­Óºô­¶
  8.             ElseIf .Parent.QueryTables.Count = 2 Then
  9.                  .WebSelectionType = xlAllTables               '¶×¤Jºô­¶©Ò¦³ªºªí®æ
  10.             ElseIf .Parent.QueryTables.Count >= 3 Then
  11.                 .WebSelectionType = xlSpecifiedTables          '¶×¤J«ü©wªººô­¶ªºªí®æ
  12.                 .WebTables = "3"            '¶×¤J«ü©w²Ä3­Óªí®æ      '=xlSpecifiedTables  ¤~¥i¥Î¦¹°Ñ¼Æ
  13.             End If
  14.             '************************************************************
  15.             .WebFormatting = xlWebFormattingNone
  16.             .WebPreFormattedTextToColumns = True
  17.             .WebConsecutiveDelimitersAsOne = True
  18.             .WebSingleBlockTextImport = False
  19.             .WebDisableDateRecognition = False
  20.             .WebDisableRedirections = False
  21.             .Refresh BackgroundQuery:=False
  22.         End With
  23.         MsgBox "²Ä" & .QueryTables.Count & "Web ¬d¸ß ºô§}" & .QueryTables(.QueryTables.Count).Connection
  24.     End With
  25. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : Ä@­n¤j¡B§Ó­n°í¡B®ð­n¬X¡B¤ß­n²Ó¡C
ªð¦^¦Cªí ¤W¤@¥DÃD