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

[µo°Ý] ½Ð°Ý³o¥i³]©wµ¥´X¬í¨S¶}ºô­¶©Îºô­¶¿ù»~´N°õ¦æ¤U¤@µ§¶Ü¡AÁÂÁÂ

[µo°Ý] ½Ð°Ý³o¥i³]©wµ¥´X¬í¨S¶}ºô­¶©Îºô­¶¿ù»~´N°õ¦æ¤U¤@µ§¶Ü¡AÁÂÁÂ

Private Sub GetDividend(ByVal ss As String)
    Dim rr As String

   rr = "http://yamstock.megatime.com.tw/asp/stockinfo/GetReport.asp?select_table=html\Ficxxx\&stockid=2412&" & ss & "&name1=D4&index1=12"     ' ¥¿½Tªº
    ¤u§@ªí2.Select
    Cells.Clear

    Set ie = CreateObject("internetexplorer.application") '¨Ï¥Î¦¹¤è¦¡¥i¥H§K°£ "³]©w¤Þ¥Î¶µ¥Ø"

    With ie
        .Visible = False 'True¬°¶}±Òie, False¬°¤£¶}±Òie
        .Navigate rr
        Do While .ReadyState <> 4 'µ¥«Ýºô­¶¶}±Ò
        DoEvents
        Loop
        .ExecWB 17, 2 'Select All
        .ExecWB 12, 2 'Copy selection
        
        ¤u§@ªí2.Range("A1").Activate
        
        ActiveSheet.PasteSpecial Format:="HTML", Link:=False, DisplayAsIcon:= _
            False, NoHTMLFormatting:=True
    End With

     ie.Quit
   End Sub

Sub AllFile()
Dim i As Integer, v

On Error Resume Next
For i = 2 To ¤u§@ªí1.Range("A" & ¤u§@ªí1.Rows.Count).End(xlUp).Row

v = ¤u§@ªí1.Cells(i, 1).Value

Call GetDividend(v)
¤u§@ªí1.Cells(i, 9).Value = ¤u§@ªí2.Cells(34, 8).Value
Debug.Print ¤u§@ªí1.Cells(i, 1).Value & " " & ¤u§@ªí1.Cells(i, 2).Value

Next

End Sub

GetDividend.rar (72.65 KB)

joey ¤j

¶K¤W¤W­±ªºµ{¦¡½X¡A´N¤£°õ¦æ¤F¡A§Ú¦A¸Õ¸Õ¡AÁÂÁÂ

TOP

µ{¦¡°õ¦æ¤¤¦³¨Ç°T®§¥i©¿¯P¡A¨Ò¦p

ÁÂÁÂ
2013-09-17_224955.png

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2013-9-19 08:26 ½s¿è

ºô§}¤U¿ù¤F¡A¦A­«¤W¸ü
Private Sub GetDividend(ByVal ss As String)
    Dim rr As String

   rr = "http://yamstock.megatime.com.tw/asp/stockinfo/GetReport.asp?select_table=html\Ficxxx\&stockid=" & ss & "&name1=D4&index1=12"     ' ¥¿½Tªº
    ¤u§@ªí2.Select
    Cells.Clear

    Set ie = CreateObject("internetexplorer.application") '¨Ï¥Î¦¹¤è¦¡¥i¥H§K°£ "³]©w¤Þ¥Î¶µ¥Ø"

    With ie
        .Visible = False 'True¬°¶}±Òie, False¬°¤£¶}±Òie
        .Navigate rr
        Do While .ReadyState <> 4 'µ¥«Ýºô­¶¶}±Ò
        DoEvents
        Loop
        .ExecWB 17, 2 'Select All
        .ExecWB 12, 2 'Copy selection
        
        ¤u§@ªí2.Range("A1").Activate
        
        ActiveSheet.PasteSpecial Format:="HTML", Link:=False, DisplayAsIcon:= _
            False, NoHTMLFormatting:=True
    End With

     ie.Quit
   End Sub

Sub AllFile()
Dim i As Integer, v

For i = 2 To ¤u§@ªí1.Range("A" & ¤u§@ªí1.Rows.Count).End(xlUp).Row



v = ¤u§@ªí1.Cells(i, 1).Value

Call GetDividend(v)
¤u§@ªí1.Cells(i, 9).Value = ¤u§@ªí2.Cells(34, 8).Value: ¤u§@ªí1.Cells(i, 10).Value = ¤u§@ªí2.Cells(33, 8).Value
¤u§@ªí1.Cells(i, 11).Value = ¤u§@ªí2.Cells(32, 8).Value: ¤u§@ªí1.Cells(i, 12).Value = ¤u§@ªí2.Cells(31, 8).Value
¤u§@ªí1.Cells(i, 13).Value = ¤u§@ªí2.Cells(30, 8).Value: ¤u§@ªí1.Cells(i, 14).Value = ¤u§@ªí2.Cells(29, 8).Value
¤u§@ªí1.Cells(i, 15).Value = ¤u§@ªí2.Cells(28, 8).Value: ¤u§@ªí1.Cells(i, 16).Value = ¤u§@ªí2.Cells(27, 8).Value

If ¤u§@ªí2.Cells(34, 8).Value > 0 And ¤u§@ªí2.Cells(33, 8).Value > 0 And ¤u§@ªí2.Cells(32, 8).Value > 0 _
And ¤u§@ªí2.Cells(31, 8).Value > 0 And ¤u§@ªí2.Cells(30, 8).Value > 0 And ¤u§@ªí2.Cells(29, 8).Value > 0 _
And ¤u§@ªí2.Cells(28, 8).Value > 0 And ¤u§@ªí2.Cells(27, 8).Value > 0 Then
¤u§@ªí1.Cells(i, 17).Value = 1
Else
¤u§@ªí1.Cells(i, 17).Value = 0
End If

Next

End Sub

=================
½Ð°Ý On Error Resume Next
­n¥Î¦b FOR NEXT ¤U¤è
ÁÙ¬O ¤U¤è

­n§PÂ_¬O§_¤j©ó0¬O­n¥Î AND ÁÙ¬O &
¦pªG¦³¤£¬O¼Æ¦rªº¨Ò"-"­n¦p¦ó
ÁÂÁÂ

GetDividend.rar (72.15 KB)

TOP

«D±`ÁÂÁÂ G¤j
µ{¦¡¤@¦¸¶]§¹¡A¦Ó¥B³£®»ªº¨ì¸ê®Æ¡A§Ú­n¤@¨Ç®É¤é¨Ó§l¦¬®ø¤Æ³o¨Çµ{¦¡^_^
¾Ç¥Í§Æ±æµ²¦X¦U°ò¥»­±ªº¸ê®Æ¡A§âµ{¦¡§@¦n¡A¦h¦h°Ñ¦Ò¯¸¤ºªºµ{¦¡¡A
µ{¦¡¯u¬O¤@ªùÃÀ³N^0^
ÁÂÁÂ

TOP

¦^´_ 7# GBKEE
½Ð°Ý G ¤j¤j
    .Range("E2").CurrentRegion = ""            '²M°£¤u§@ªí1,¦~«×½d³ò
¬O¤£¬O±q E2 ¶}©l²M°£ «ç E1 D2 ªº ²{ª÷ªÑ§Q        ªÑ²¼ªÑ§Q ¤]§R¤F
¦³ªº¸ê®Æ¦³®É®»¤£¨ì
½Ð°Ý¦p¦ó¤~¯à½T«O®»¨ì
ÁÂÁÂ G ¤j


Option Explicit
Dim ie As Object   '¼Ò²Õ³Ì³»ºÝ Dim ¨Ñ³o¼Ò²Õªºµ{§Ç¨Ï¥ÎªºÅܼÆ
Sub AllFile()
    Dim i As Integer, v, Y As Integer, S As String
      Set ie = CreateObject("internetexplorer.application")   '¨Ï¥Î¦¹¤è¦¡¥i¥H§K°£ "³]©w¤Þ¥Î¶µ¥Ø"
    With ie 'ÁY¤pIEµøµ¡
        .Visible = True
        .Width = 5
        .Height = 5
    End With
    With ¤u§@ªí1

'        .Range("E2").CurrentRegion = ""            '²M°£¤u§@ªí1,¦~«×½d³ò
        For i = 2 To .Range("A" & .Rows.Count).End(xlUp).Row
            v = .Cells(i, 1).Value
            GetDividend (v)
            ¤u§@ªí2.Range("D4").CurrentRegion.Replace "--", "", xlWhole

            .Cells(i, 5).Resize(, 2).Value = ¤u§@ªí2.Cells(4, 4).Resize(, 2).Value
            
        Next
    End With
    With ie  'IEµøµ¡³Ì¤j¤Æ
        Application.WindowState = xlMaximized
        .Height = Application.Height
        .Width = Application.Width
        .Quit
    End With
End Sub
Private Sub GetDividend(ByVal ss As String)

    Dim rr As String, T As Date, i, ii, k, j, S
    On Error Resume Next
    T = Time
    rr = "http://yamstock.megatime.com.tw/asp/stockinfo/GetReport.asp?select_table=html\Ficxxx\&stockid=" & ss & "&name1=D4&index1=12"     ' ¥¿½Tªº
    With ie
        .Navigate rr
        Do While .ReadyState <> 4                          'µ¥«Ýºô­¶¤U¸ü§¹²¦
              DoEvents
              If Time >= T + #12:00:03 AM# Then            'µ¥«Ý3¬í
                DoEvents
                Application.SendKeys "~"                    'ªÑ²¼¥N¸¹¿ù»~,ºô­¶·|¦³°T®§,¶·«ö½T©w,¤~¥iÄ~Äò¤U­±ªÑ²¼¥N¸¹
                Exit Do
              End If
        Loop
        Set S = .Document.getelementsbytagname("table")(4) ' ·sªº table 4

        With ¤u§@ªí2
            .UsedRange.Clear

            For i = 0 To S.Rows.Length - 1      '¼g¤J¸ê®Æ
                k = k + 1
                For j = 0 To S.Rows(i).Length - 1
                    For ii = 0 To S.Rows(i).Cells.Length - 1
                    .Cells(k, ii + 1) = S.Rows(i).Cells(ii).innertext
                    DoEvents
                    Next
                Next
            Next
        End With
    End With

   End Sub

°t®§´ú¸Õ.rar (19.29 KB)

TOP

¥»©«³Ì«á¥Ñ wufonna ©ó 2014-9-1 20:00 ½s¿è

¦^´_ 10# GBKEE

ÁÂÁÂ G ¤j¤j

¦A½Ð°Ý GBKEE  ¤j¤j
¦³®Éºô­¶®»¤£¨ì¬Oºô­¶ªº°ÝÃD ¥i¥H¸Ñ¨M¶Ü
¬O§ï Application.SendKeys "~" ¶Ü

ÁÙ¦³¤U­±¬O¿ù»~¬O¤°ºô­¶¿ù»~¶Ü
ÁÂÁÂ
2014-09-01_194704.jpg
2014-09-01_194704.jpg
2014-09-01_195532.jpg

TOP

¦^´_ 11# wufonna


    ½Ð°Ý G ¤j¤j ¬O
   If Time >= T + #12:00:08 AM# Then        
µ¥¥N®É¶¡¤Öªº°ÝÃD¶Ü §Ú±N3¬í§ï8¬í´N¨S¿ù¤F
¦pªGªÑ²¼¦h¤F¦p¦ó¸Ñ¨M ÁÂÁÂ

TOP

¦^´_ 13# GBKEE

GBKEE ¤j¤j
µ{¦¡¨S¦³¿ù»~
¥i¬O¦³®É¸ê®Æ¨S®»¨ì
¹³³o¦¸ ³Ó¤@ ¨S®»¨ì
ÁÂÁÂ
2014-09-02_171247.jpg

°t®§´ú¸Õ-2.rar (21.67 KB)

TOP

¦^´_ 16# GBKEE


    ÁÂÁÂ G ¤j¤j
    µ{¦¡¹B¦æ¶¶ºZ ^_^
   
¥»·Q¤Gºûªºªí³æ«ç·|¦³¤T­Ó FOR NEXT
¥¿·Qµo°Ý

¦A½Ð¦b G ¤j¤j
·s¤â¦p¦ó¥hµo²{µ{¦¡¤¤¨S¦³¿ù»~ªºÅܤÆ
¹³µ{¦¡¤¤ªº
Do
        Set S = .Document.getElementsByTagName("table")(4) ' ·sªº table 4
        Loop Until Not S Is Nothing
ÁÂÁÂ

TOP

        ÀR«ä¦Û¦b : ¤@¥y·Å·xªº¸Ü¡A´N¹³©¹§O¤H¨­¤WÅx­»¤ô¡A¦Û¤v·|ªg¨ì¨â¤Tºw¡C
ªð¦^¦Cªí ¤W¤@¥DÃD