用Excel 開VBA編輯, 設一個按鈕把以下程式碼填進去
這樣可以取得資料, 至於後續要怎麼處理, 就看個人了~
複製程式
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;[url]http://tw.stock.yahoo.com/q/q?s=2350"[/url], Destination:=Range("A1"))
.Name = "q?s=2350"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "7"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With