Board logo

標題: 請問可以邦我看一下這程式碼嗎? [打印本頁]

作者: vavashop    時間: 2015-2-11 20:00     標題: 請問可以邦我看一下這程式碼嗎?

我A8 是 想複製日期後
到其他分頁  到連結外部網頁 把日期給改掉
但 這巨集路好
後面該怎麼改  請幫幫忙


'
    Range("A1").Select
    Sheets("上市").Select
    Range("B8").Select
    Selection.Copy
    Range("A8").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Range("A8").Select
    Application.CutCopyMode = False
    ActiveCell.FormulaR1C1 = "104/02/11"
    Sheets("上櫃").Select
    With Selection.QueryTable
        .Connection = _
        "URL;http://www.gretai.org.tw/web/stock/aftertrading/daily_close_quotes/stk_quote_print.php?l=zh-tw&d=104/02/11"
        .WebSelectionType = xlEntirePage
        .WebFormatting = xlWebFormattingNone
        .WebPreFormattedTextToColumns = True
        .WebConsecutiveDelimitersAsOne = True
        .WebSingleBlockTextImport = False
        .WebDisableDateRecognition = False
        .WebDisableRedirections = True
        .Refresh BackgroundQuery:=False
    End With
    Sheets("投信(上櫃)").Select
      Range("A1").Select
    With Selection.QueryTable
        .Connection = _
        "URL;http://www.gretai.org.tw/web/stock/3insti/sitc_trading/sitctr_print.php?l=zh-tw&t=D&type=buy&d=104/02/11"
        .WebSelectionType = xlEntirePage
        .WebFormatting = xlWebFormattingNone
        .WebPreFormattedTextToColumns = False
        .WebConsecutiveDelimitersAsOne = True
        .WebSingleBlockTextImport = False
        .WebDisableDateRecognition = False
        .WebDisableRedirections = True
        .Refresh BackgroundQuery:=False
    End With
       Range("A180").Select
    With Selection.QueryTable
        .Connection = _
        "URL;http://www.gretai.org.tw/web/stock/3insti/sitc_trading/sitctr_print.php?l=zh-tw&t=D&type=sell&d=104/02/11"
        .WebSelectionType = xlEntirePage
        .WebFormatting = xlWebFormattingNone
        .WebPreFormattedTextToColumns = False
        .WebConsecutiveDelimitersAsOne = True
        .WebSingleBlockTextImport = False
        .WebDisableDateRecognition = False
        .WebDisableRedirections = True
        .Refresh BackgroundQuery:=False
    End With
   
    Sheets("上市").Select
End Sub




歡迎光臨 麻辣家族討論版版 (http://forum.twbts.com/)