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

[µo°Ý] §ä¤£¨ìªººô­¶¦p¦ó³]©w¦Û°Ê¸õ¹L,µM«á°õ¦æ¤U¤@­Ó©O?

[µo°Ý] §ä¤£¨ìªººô­¶¦p¦ó³]©w¦Û°Ê¸õ¹L,µM«á°õ¦æ¤U¤@­Ó©O?

¥»©«³Ì«á¥Ñ norafang ©ó 2014-2-2 10:40 ½s¿è

­è§ä¤F¤@¤U,¬ÛÃö¥DÃD§ä¤£¨ì§Ú­nªºµª®×,©Ò¥H·Q»¡°Ý¬Ý¬Ý¦³¨S¦³¤j¤j¥i¥HÀ°¦£¸Ñ¨M
¤º®e¬O,§Ú¦³¤@­ÓºÞ±±ªí©T©w¥h®»¤@¨Ç¯S©wºô¯¸ªºªÑ²¼¸ê®Æ,¦ý¦³¨Çºô¯¸¤]³\¨Ã¨S¦³²Å¦X¨C¤@ÀɪѲ¼ªº¸ê®Æ´N·|²£¥Í¿ù»~
¤ñ¦p§Ú¦b®»¥x¿n¹q2330¤]³\¦byahoo·|¦³¤½¥q¸ê®Æ,¦ý¥xÆW50, 0050¤]³\´N®»¤£¨ì¤F,
¹J¨ì³oºØ¬ÛÃöªº¼gªk,¤S¤£·Q¦]§ä¤£¨ì´N¤¤Â_µ{¦¡ªº°ÝÃD,¦p¦ó¼g¤@¬qÅý¥¦§ä¤£¨ì´N¸õ¹L¥h¸Óºô¯¸,¦A¶i¦æ¤U¤@­Óºô¯¸ªº®»¨ú©O?
¦]¬°¾ã­Ó¼gªk«Üªø,§Ú§â§Ú¼gªº«e¤G­Ó®»¨úºô¯¸¶K¤W,§Úªº0050´N°±¦b²Ä¤G­Óºô§}´N¶]¤£¤U¥h¤F

x = Worksheets("ºÞ±±ªí").Range("a1")
    datetake = Format(Now, "yyyy-m-dd")
    datetake180 = Format(Now - 180, "yyyy-m-dd")
    yeartake = Format(Now, "yyyy")
    yeartakech = Worksheets(Sheets.Count).Range("a43")
    siteshow = "http://money.hinet.net/z/z0/z00/z00a_" & x & "_" & datetake180 & "_" & datetake & "_M.djhtm"
'    MsgBox siteshow
    Worksheets("copy").Copy after:=Worksheets(Sheets.Count)
    With ActiveSheet.QueryTables.Add(Connection:= _
        "URL;http://tw.stock.yahoo.com/q/q?s=" & x, Destination:=Worksheets(Sheets.Count).Range("$AA$1"))
        .Name = "q?s=" & x
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .BackgroundQuery = True
        .RefreshStyle = xlOverwriteCells
        .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
    With ActiveSheet.QueryTables.Add(Connection:= _
        "URL;http://tw.stock.yahoo.com/d/s/company_" & x & ".html", Destination:=Worksheets(Sheets.Count).Range( _
        "$AA$9"))
        .Name = "company_" & x
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .BackgroundQuery = True
        .RefreshStyle = xlOverwriteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .WebSelectionType = xlSpecifiedTables
        .WebFormatting = xlWebFormattingNone
        .WebTables = "9,10,11"
        .WebPreFormattedTextToColumns = True
        .WebConsecutiveDelimitersAsOne = True
        .WebSingleBlockTextImport = False
        .WebDisableDateRecognition = False
        .WebDisableRedirections = False
        .Refresh BackgroundQuery:=False
    End With
end sub

¦^´_ 1# norafang
½Ð¸Ô¬ÝVBA»¡©ú¤¤ªº On Error ³¯­z¦¡
µ{§Çªº¶}©l¥[¤W
  1. On Error Resume Next   'ªí¥Ü·í¤@­Ó°õ¦æ¶¥¬q¿ù»~²£¥Í®É¡Aµ{¦¡±±¨î¥ß¨è¨ìµo¥Í¿ù»~³¯­z¦¡±µ¤U¥hªº³¯­z¦¡¡A¦ÓÄ~Äò°õ¦æ¤U¥h
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 2# GBKEE

¸Õ¹L,¥i¥H¥Î
ÁÂÁÂG¤jªº¦^µª¤Î¸Ñ¨M§Ú§xÂZªº°ÝÃD,

TOP

        ÀR«ä¦Û¦b : ¦n¨Æ­n´£±o°_¡A¬O«D­n©ñ±o¤U¡A¦¨´N§O¤H§Y¬O¦¨´N¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD