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

[µo°Ý] «ç¼Ë¥ÎVBA±N¤À­¶¤ºªº¤£¦P¦C¸ê®Æ§ó·s«á¡A¦Û°Ê¶ñ¤J¨ì¤£¦P¤À­¶ªº¬Y¤@¦C¡H

[µo°Ý] «ç¼Ë¥ÎVBA±N¤À­¶¤ºªº¤£¦P¦C¸ê®Æ§ó·s«á¡A¦Û°Ê¶ñ¤J¨ì¤£¦P¤À­¶ªº¬Y¤@¦C¡H

½Ð°Ý¯à°µ¨ì·í§Ú¸ê®Æ­¶§ó·s¸ê®Æ«á¡A©Ò«ü©wªº¦C¸ê®Æ´N¼g¤J­Ó§O¤À­¶¡A¥B±q¤W¤@µ§³Q¬ö¿ýªº¸ê®Æ¨Ì§Ç©¹¤U°O¿ý¤U¥h¶Ü¡H
Àµ½Ð½ç±Ð¡AÁÂÁÂ~


Test.zip (53.14 KB)

¦^´_ 1# leondavinci727
  1. Sub activateMacro()
  2. Dim dic As Object, ky, A As Range, r%
  3. Set dic = CreateObject("Scripting.Dictionary")
  4.     Dim com_no As String
  5.         com_no = Worksheets("ÃþD").Range("$K$3").Value
  6. With ActiveSheet.QueryTables("ÃþD")
  7. .Connection = "URL;http://www.twse.com.tw/ch/trading/exchange/BFIAMU/genpage/Report201303/" & com_no & "_F3_1_5.php?chk_date=102/03/26"
  8. .FieldNames = True
  9. .RowNumbers = False
  10. .FillAdjacentFormulas = False
  11. .PreserveFormatting = True
  12. .RefreshOnFileOpen = False
  13. .BackgroundQuery = True
  14. .RefreshStyle = xlOverwriteCells
  15. .SavePassword = False
  16. .SaveData = True
  17. .AdjustColumnWidth = False
  18. .RefreshPeriod = 0
  19. .WebFormatting = xlWebFormattingNone
  20. .WebTables = "8"
  21. .WebPreFormattedTextToColumns = True
  22. .WebConsecutiveDelimitersAsOne = True
  23. .WebSingleBlockTextImport = False
  24. .WebDisableDateRecognition = False
  25. .WebDisableRedirections = False
  26. .Refresh BackgroundQuery:=False
  27. End With
  28. r = 35
  29. Do Until Cells(r, 1) = ""
  30. dic(Cells(r, 1).Value) = Range(Cells(r + 1, 1), Cells(r + 1, 1).End(xlToRight)).Value
  31. r = r + 2
  32. Loop
  33. For Each ky In dic.keys
  34.    With Sheets(ky)
  35.    Set A = .Cells(.Rows.Count, 1).End(xlUp).Offset(1, 0)
  36.    A.Resize(, UBound(dic(ky), 2)) = dic(ky)
  37.    End With
  38. Next
  39. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 2# Hsieh
:D  «D±`·PÁ Hsieh ¶W¯Åª©¥DªºÀ°¦£¡I °õ¦æ§¹¥þµL»~¡AÁÂÁ±z¨º»ò§Ö³tªº¦ù¥X´©¤â¡A¤p§Ì¦³«Ü¦h¬Ý¤£À´ªº¦a¤è­n¦b¦n¦n¬ã¨s¡A«D±`·PÁÂ~

TOP

        ÀR«ä¦Û¦b : ¤Ñ¤W³Ì¬ü¬O¬P¬P¡A¤H¥Í³Ì¬ü¬O·Å±¡¡C
ªð¦^¦Cªí ¤W¤@¥DÃD