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

[µo°Ý] ¤@­Ó¥ÎVBA±qºô­¶¨ú±o·Q­n¸ê®Æªº¼gªk~

½Ð±ÐGBKEE¶W¯Åª©¥D:
¥H¤Uºô­¶ªºVBA­n¦p¦ó¼g
https://tw.futures.finance.yahoo.com/future/options.html?opmr=optionfull&opcm=WTXO&opym=201509
cotton

TOP

¦^´_ 25# alantsai777
¹j 10 ¬í¦Û°Ê§ó·s ?? ³oºô­¶ ¶¡¹j 5 ¬í¦Û°Ê§ó·s!!
µ{¦¡½X½Æ»s¨ì¤@¯ë¼Ò²Õ
  1. Option Explicit
  2. Dim IE As Object
  3. Sub Ex_°ò¥»¥«ªp³ø¾Éºô¯¸()
  4.     Dim A As Object, xDate As Date, EDATE As Date
  5.     Set IE = CreateObject("InternetExplorer.Application")
  6.     With IE
  7.        ' .Visible = True
  8.         .Navigate "http://mis.twse.com.tw/stock/fibest.jsp?stock=3673"
  9.         Do While .Busy Or .readyState <> 4: DoEvents: Loop
  10.     End With
  11.     Ex_°Æµ{¦¡
  12. End Sub
  13. Private Sub Ex_°Æµ{¦¡()
  14.     Dim A As Object, K As Integer, i As Integer, ii As Integer
  15.     With IE
  16.         Do While .Busy Or .readyState <> 4: DoEvents: Loop
  17.         Set A = .Document.getElementsByTagName("table")(1)
  18.     End With
  19.     With ActiveSheet    '¥i«ü©w¤u§@ªí
  20.         .UsedRange.Clear
  21.         K = 1
  22.         For i = 0 To A.Rows.Length - 1
  23.             For ii = 0 To A.Rows(i).Cells.Length - 1
  24.                 .Cells(K, ii + 1) = A.Rows(i).Cells(ii).INNERTEXT
  25.             Next
  26.             K = K + 1
  27.         Next
  28.     End With
  29.     If Time <= #1:30:00 PM# Then   '¦¬½L®É¶¡ ¦Û¦æ½Õ¾ã
  30.         Application.OnTime Time + #12:00:05 AM#, "Ex_°Æµ{¦¡"  '¶¡¹j5¬í
  31.     Else
  32.         IE.Quit
  33.     End If
  34. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

½Ð°Ý¦pªGºô­¶¨C10¬í¸ê®ÆÅÜ°Ê
¦p
http://mis.twse.com.tw/stock/fibest.jsp?stock=3673
¹j 10 ¬í¦Û°Ê§ó·s
[¤W¥«] 3673 F-TPK(¤¸¡A¥æ©ö³æ¦ì)
³Ìªñ
¦¨¥æ»ù        º¦¶^»ù®t
(¦Ê¤À¤ñ)        ·í½L
¦¨¥æ¶q        ²Ö¿n
¦¨¥æ¶q        ´¦¥Ü
¶R»ù        ´¦¥Ü
¶R¶q        ´¦¥Ü
½æ»ù        ´¦¥Ü
½æ¶q        ¶}½L        ³Ì°ª        ³Ì§C        »¡©ú
200.00        ¡¶1.50(0.76%)        359        2118        199.50        11        200.00        58        199.50        200.50        198.00       
¯à§_½ÐÀ°¦£§iª¾¦p¦ó§ì ÁÂÁÂ

TOP

¦^´_ 23# GBKEE
G¤j,·PÁ±z,¤w¸g¥i¥H¶]¤F,ÁöµM¤º®e¦³«Ü¦h§ÚÁÙ¬O¤£¤Ó¤F¸Ñ,¦ý±z¤w¸gµ¹¤F«Ü¤jªº¤è¦V¤F,·PÁ­ò!

TOP

¦^´_ 22# norafang
VBAªº¸gÅç­È¤Ó¤Ö¤F,»Ý¦h­×·Ò 21# ªºµ{¦¡½X¬O¦b»¡©ú Const ³¯­z¦¡
  1. Option Explicit
  2. Sub Test()
  3.     Dim x, ur As String, IE As Object
  4.     x = Worksheets("sheet1").Range("a1")
  5.   '  Const url As String = "http://jsjustweb.jihsun.com.tw/z/zc/zcl/zcl_AAAA.asp.htm"
  6.    ' MsgBox url
  7.     ur = "http://jsjustweb.jihsun.com.tw/z/zc/zcl/zcl_" & x & ".asp.htm"
  8.    ' MsgBox ur
  9.     Set IE = CreateObject("internetexplorer.application") '¨Ï¥Î¦¹¤è¦¡¥i¥H§K°£ "³]©w¤Þ¥Î¶µ¥Ø"
  10.     With IE
  11.         .Visible = False 'True¬°¶}±Òie, False¬°¤£¶}±Òie
  12.         .Navigate ur
  13.         Do While .ReadyState <> 4 'µ¥«Ýºô­¶¶}±Ò
  14.             DoEvents
  15.         Loop
  16.         .ExecWB 17, 2 'Select All
  17.         .ExecWB 12, 2 'Copy selection
  18.         With Sheets("Sheet1")
  19.              .Cells.Clear
  20.             '.Cells.Select
  21.             .Range("AA1").Activate
  22.             .PasteSpecial Format:="HTML", Link:=False, DisplayAsIcon:= _
  23.                 False, NoHTMLFormatting:=True
  24.         End With
  25.     End With
  26.     Columns("A:B").Delete
  27.     IE.Quit
  28.     MsgBox "¸ê®Æ½Æ»sµ²§ô"
  29. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 21# GBKEE
G¤j,ÁÂÁ±zªº­@¤ß«ü±Ð,¨Ì±zªº¤è¦¡,§Úªº¼gªk¦p¤U:
¦³¥H¤U´X­Ó°ÝÃD
1.¬°¦ó§Ú¤w«ü©w¥N¸¹¦bA1,¦ý±a¥XªíÀY,¦Ó¨S¦³¸ê®Æ?

2.¬°¦ó§Ú«ü©w©ñ¸m¦ì¸m©óRange("AA1").Activate,¶]§¹ÁÙ¬O©ñ¦bA2?
                                                       
Sub Test()
    Dim x, ur As String
    x = Worksheets("sheet1").Range("a1")
    Const url As String = "http://jsjustweb.jihsun.com.tw/z/zc/zcl/zcl_AAAA.asp.htm"
    MsgBox url
    ur = "http://jsjustweb.jihsun.com.tw/z/zc/zcl/zcl_" & x & ".asp.htm"
    MsgBox ur
    Cells.Clear
    Set ie = CreateObject("internetexplorer.application") '¨Ï¥Î¦¹¤è¦¡¥i¥H§K°£ "³]©w¤Þ¥Î¶µ¥Ø"
    With ie
        .Visible = False 'True¬°¶}±Òie, False¬°¤£¶}±Òie
        .Navigate url
        Do While .ReadyState <> 4 'µ¥«Ýºô­¶¶}±Ò
            DoEvents
        Loop
        .ExecWB 17, 2 'Select All
        .ExecWB 12, 2 'Copy selection
        Sheets("Sheet1").Cells.Select
        Range("AA1").Activate
        ActiveSheet.PasteSpecial Format:="HTML", Link:=False, DisplayAsIcon:= _
                False, NoHTMLFormatting:=True
    End With
    Columns("A:B").Delete
    ie.Quit
    MsgBox "¸ê®Æ½Æ»sµ²§ô"
End Sub

    ·Ð½ÐG¤j¦AÀ°§Ú¬Ý¬Ý,ÁÂÁÂ

TOP

¦^´_ 20# norafang
§A­n¥ÎIE¶×¤J¥~³¡¸ê®Æ¬OµLªk¥Î¿ý»s,
¥\¯àªí«ü¥O:¸ê®Æ-> ¶×¤J¥~³¡¸ê®Æ,¥i¥H¥Î¿ý»s¤U¨Ó­×§ï
19#ªº°ÝÃD ­n¦h¬Ý¬ÝVBA»¡©úªº ¨ç¼Æ,¤èªk,³¯­z¦¡,ÄÝ©Ê.¨Ó¤F¸Ñ¥Îªk,¥i¦Ê¤Ø¬ñÀY,§óªñ¤@¨B.
  1. Option Explicit
  2. 'Const ³¯­z¦¡ «Å§i±`¼Æ , ¨ä­È¦p¦r­±©Ò¥Ü
  3. Sub a()
  4.     Dim x, ur As String
  5.     x = "2022"
  6.     Const url As String = "http://jsjustweb.jihsun.com.tw/z/zc/zcl/zcl_AAAA.asp.htm"
  7.     MsgBox url
  8.     ur = "http://jsjustweb.jihsun.com.tw/z/zc/zcl/zcl_" & x & ".asp.htm"
  9.     MsgBox ur
  10. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¹ï¤F,¶¶«K¦A¸É°Ý¤@¤U,Ãþ¦ü³oºØºô¯¸,¥i¥H¥Î¿ý»s¥¨¶°ªº¤è¦¡¦A¤U¥h­×§ï¶Ü?
ÁÙ¬O¥²¶·¨Ì¤W­±¤j¤jªº¼gªk¤U¥h­×§ï©O?
¦]¬°¾a¦Û¤v¼g¥X¨Ó,¤£¥Î¨C¦¸³£¾a§O¤HÀ°¦£,ÁÂÁÂ

TOP

¦^´_  white5168
¦^´_  vesperlee
½Ð¸Õ¸Õ¬Ý¡I
c_c_lai µoªí©ó 2012-5-1 16:42

§Ú§âCC¤jªºµ{¦¡­×§ï§Ú·Q­nªÑ²¼¦WºÙ,¦ý¬°¦ó·|¶]¥X"¥²¶·¬O±`¼Æ¹Bºâ¦¡"ªº¿ù»~°T®§,½Ð°Ý§Ú¤U­±ªº¼gªk¦³¿ù¶Ü?
¨º¤£µM­n¦p¦ó§ó§ï¦Û¤v·Q­nªºªÑ²¼¥N¸¹©O?
½Ð«ü±Ð§Ú³o­ÓVBA·s¤â,ÁÂÁÂ

Sub a()
    x = Worksheets("sheet1").Range("l1")
    Const url As String = "http://jsjustweb.jihsun.com.tw/z/zc/zcl/zcl_" & x & ".asp.htm"
    Cells.Clear
    Set ie = CreateObject("internetexplorer.application") '¨Ï¥Î¦¹¤è¦¡¥i¥H§K°£ "³]©w¤Þ¥Î¶µ¥Ø"
    With ie
        .Visible = False 'True¬°¶}±Òie, False¬°¤£¶}±Òie
        .Navigate url
        Do While .ReadyState <> 4 'µ¥«Ýºô­¶¶}±Ò
            DoEvents
        Loop
        .ExecWB 17, 2 'Select All
        .ExecWB 12, 2 'Copy selection
        Sheets("Sheet1").Cells.Select
        Range("A1").Activate
        ActiveSheet.PasteSpecial Format:="HTML", Link:=False, DisplayAsIcon:= _
                False, NoHTMLFormatting:=True
    End With
    Columns("A:B").Delete
    ie.Quit
    MsgBox "¸ê®Æ½Æ»sµ²§ô"
    End Sub

TOP

G¤j¡A
®É¶¡¨º»ò¤[¤F¡A§Ú³£§Ñ¤F¦³°Ý¹L³o­Ó°ÝÃD¡AÁÙ¦³³Ò±z¶O¤ß¡A¯u¤£¦n·N«ä¡CÁÂÁ¡ã

TOP

        ÀR«ä¦Û¦b : «H¤ß¡B¼Ý¤O¡B«i®ð¤TªÌ¨ã³Æ¡A«h¤Ñ¤U¨S¦³°µ¤£¦¨ªº¨Æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD