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

[µo°Ý] ³s±µºô¸ô§ì¨ú¸ê®Æ¶×¤J¤u§@ªí³t«×ºC?¦³µL¿ìªk§ïµ½?

½Ð°Ý¦¹ºô­¶¦³µL¿ìªk¶×¤Jexcel ?

http://udn.megatime.com.tw/asp/hot/ShortOperate.asp?lcount=20&m=puplim&align=v

TOP

¦^´_ 1# t8899
  1. Sub Ex()
  2.     Dim xlVbTable As Object, Ar, R As Integer, C As Integer, i As Variant, Y As Integer
  3.     With CreateObject("InternetExplorer.Application")
  4.         .Visible = True
  5.        .Navigate "http://udn.megatime.com.tw/asp/hot/ShortOperate.asp?lcount=20&m=puplim&align=v"
  6.         Do While .Busy Or .ReadyState <> 4: DoEvents: Loop
  7.         Set xlVbTable = .document.getelementsbytagname("table")
  8.         On Error Resume Next
  9.         With ActiveSheet
  10.             .Cells.Clear
  11.             .Cells(1, 1) = "º¦°±ÂꦺªÑ"
  12.             Y = 2
  13.             For Each i In Array(20, 24)
  14.                 If i = 24 Then .Cells(Y, 1) = "¶^°±ÂꦺªÑ": Y = Y + 1
  15.                 For R = 0 To xlVbTable(i).Rows.Length - 1
  16.                     For C = 0 To xlVbTable(i).Rows(1).ALL.Length - 1
  17.                         .Cells(Y, C + 1) = xlVbTable(i).Rows(R).Cells(C).innerText
  18.                     Next
  19.                     Y = Y + 1
  20.                 Next
  21.             Next
  22.             .Rows(13).Delete
  23.         End With
  24.        .Quit
  25.     End With
  26. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_  t8899
GBKEE µoªí©ó 2013-9-3 07:59


½Ð°Ý¤£·Q¬Ý¨ìie8 ¥X²{­n§R±¼¨º¤@¦æ©O?

TOP

¦^´_ 3# t8899
°Q½×°Ï¸Ì¦³³\¦hÃþ¦üªº°Q½×,¦Û¤v¸ÕµÛ§R¬Ý¬Ý.
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_  t8899
°Q½×°Ï¸Ì¦³³\¦hÃþ¦üªº°Q½×,¦Û¤v¸ÕµÛ§R¬Ý¬Ý.
GBKEE µoªí©ó 2013-9-3 10:55

§Ú¬O§ï  CreateObject("InternetExplorer.Application") .Visible = FALSE

¥i¥H±N"¶^°±ÂꦺªÑ" ±q J1 ¶}©l±Æ¶Ü??

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2013-9-4 12:37 ½s¿è

¦^´_ 5# t8899
¦h½m²ß¤@¤UVBA´N·|¶i¨B(¤£·|¨Ã¤£¤@©w­n°Ý¤Hªº)
  1. Option Explicit
  2. Sub Ex()
  3.     Dim xlVbTable As Object, Ar, R As Integer, C As Integer, i As Variant, Y As Integer
  4.     Dim t As Date
  5.     t = Time
  6.     With CreateObject("InternetExplorer.Application")
  7.        ' .Visible = True
  8.        .Navigate "http://udn.megatime.com.tw/asp/hot/ShortOperate.asp?lcount=20&m=puplim&align=v"
  9.         Do While .Busy Or .ReadyState <> 4: DoEvents: Loop
  10.         Set xlVbTable = .document.getelementsbytagname("table")
  11.         On Error Resume Next
  12.         With ActiveSheet
  13.             .Cells = ""
  14.             .Cells(1, 1) = "º¦°±ÂꦺªÑ"
  15.             For Each i In Array(20, 24)
  16.                 If i = 24 Then .Cells(1, "J") = "¶^°±ÂꦺªÑ"
  17.                 Y = 2
  18.                 For R = 0 To xlVbTable(i).Rows.Length - 1
  19.                     For C = 0 To xlVbTable(i).Rows(1).ALL.Length - 1
  20.                         .Cells(Y, C + IIf(i = 20, 1, 10)) = xlVbTable(i).Rows(R).Cells(C).innerText
  21.                         'IIf(i = 20, 1, 10) ->  1:="A", 10:="J"
  22.                     Next
  23.                     Y = Y + 1
  24.                 Next
  25.                 If i = 20 Then .Rows(13).Delete
  26.             Next
  27.         End With
  28.        .Quit
  29.     End With
  30.     MsgBox Application.Text(Time - t, "¶O®É [ss] ¬í")
  31. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¥»©«³Ì«á¥Ñ t8899 ©ó 2013-9-3 20:33 ½s¿è

¦^´_ 6# GBKEE
ÁÂÁÂ!¦A½Ð±Ð¤@¤U
·í§Ú¦b­«·s§ó·s«á,°Ñ·Ó¦¹ªíªºÀx¦s®æ(¶K¤W³sµ²)¦³¨Ç·|¥X²{ #REF!¡A»Ý­«·s³]©wÀx¦s®æ°Ñ·Ó¤~·|«ì´_¥¿±`, ¦³µL¿ìªk¸Ñ¨M?
=º¦¶^°±!C12
§ó·s«á  ===> =º¦¶^°±!#REF!

TOP

¥»©«³Ì«á¥Ñ t8899 ©ó 2013-9-3 21:19 ½s¿è

·Q¨ì¤@­Ó¿ìªk
ª½±µ¦b±z¼gªº¥¨¶°¤§«á¥[¤W
Sheets("¸Õºâ").Range("P3:P56").Value = Sheets("º¦¶^°±").Range("G3:G56").Value
Sheets("¸Õºâ").Range("O3:O56").Value = Sheets("º¦¶^°±").Range("C3:C56").Value
Sheets("¸Õºâ").Range("Q3:Q56").Value = Sheets("º¦¶^°±").Range("P3:P56").Value
Sheets("¸Õºâ").Range("R3:R56").Value = Sheets("º¦¶^°±").Range("L3:L56").Value

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2013-9-4 09:00 ½s¿è

¦^´_ 8# t8899
.Cells.Clear §ï¦¨->.Cells="" ¸Õ¸Õ¬Ý
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_  t8899
.Cells.Clear §ï¦¨->.Cells.="" ¸Õ¸Õ¬Ý
GBKEE µoªí©ó 2013-9-4 07:14


»yªk¿ù»~?

TOP

        ÀR«ä¦Û¦b : ¦Y­W¤F­W¡B­WºÉ¤Ü¨Ó¡A¨ÉºÖ¤FºÖ¡BºÖºÉ´d¨Ó¡C
ªð¦^¦Cªí ¤W¤@¥DÃD