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

¨Ï¥ÎVBA§ì¨úºô­¶¸ê®Æ¡A¤j¬ù¤£¨ì200­¶´N·|·í±¼¡A¨D¸Ñ

¦^´_ 3# clio
¨S¦³§Oªººô§}¥i¤U¸ü¶Ü?
´ú¨ì1500­¶¶]ªñ10¤ÀÄÁ, 40377 ­¶­n¶]«Ü¤[½Ð¦Û¤v´ú¸Õ
  1. Option Explicit
  2. Sub Ex()
  3.     Dim Sh(1 To 2) As Worksheet, q As QueryTable, i  As Long, Rng As Range
  4.     Dim xTime As Date
  5.     With ThisWorkbook
  6.         Set Sh(1) = .Sheets(1)
  7.         Set Sh(2) = .Sheets(2)  '**.Sheets("¤u§@ªí3")
  8.     End With
  9.     With Sh(1)
  10.        '****³o¬q¬O­n§R°£¤u§@ªí1¤W¦³¤Ó¦hªº QueryTable  (·|·í¥i¯à¬O¦b³o)****   
  11.         For Each q In .QueryTables
  12.             q.Delete
  13.         Next
  14.         '****³o¬q¬O­n§R°£¤u§@ªí1¤WQueryTableªº¦WºÙ
  15.         For i = .Names.Count To 1 Step -1
  16.             .Names.Item(i).Delete
  17.         Next
  18.         '**³]©w§Aªº¥~³¡¬d¸ß¦b©T©wªºQueryTable¤W
  19.         If .QueryTables.Count > 0 Then
  20.             Set q = .QueryTables(1)
  21.         Else
  22.             Set q = .QueryTables.Add(Connection:="URL;http://www.passivecomponent.com/asp/search_chip.aspx?page=1" _
  23.                         , Destination:=.[A1])
  24.         End If
  25.     End With
  26.     xTime = Time
  27.     Application.ScreenUpdating = False
  28.     For i = 1 To 40377
  29.         With q
  30.             .Connection = "URL;http://www.passivecomponent.com/asp/search_chip.aspx?page=" & i
  31.             .WebFormatting = xlNone
  32.             .RefreshStyle = xlInsertDeleteCells
  33.             .AdjustColumnWidth = True
  34.             .Refresh BackgroundQuery:=False
  35.             DoEvents
  36.             Set Rng = .ResultRange '**¥~³¡¬d¸ßªº¸ê®Æ°Ï
  37.             If i = 1 Then
  38.                 Sh(2).UsedRange.Clear
  39.                 Sh(2).Range("A1").Resize(Rng.Rows.Count, Rng.Columns.Count) = Rng.Value
  40.             Else
  41.                 Sh(2).Range("A" & Sh(2).Cells(Rows.Count, 1).End(xlUp).Row + 1).Resize(Rng.Rows.Count, Rng.Columns.Count) = Rng.Offset(1).Value
  42.             End If
  43.         End With
  44.         Application.StatusBar = "¤U¸ü¶}©l: " & xTime & " ¦@ " & i & " ­¶ ok " & Application.Text(Time - xTime, ["m¤Às¬í"])
  45.     Next
  46.     Application.ScreenUpdating = True
  47.     MsgBox Application.Text(Time - xTime, ["m¤Às¬í"]) & "   Finish"
  48. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2018-10-9 12:56 ½s¿è

¦^´_ 7# clio
ÀÉ®×½G¨­
QueryTable ,Name¤Ó¦hÀÉ®×·|µê­D,§A¤@ª½ªº¦sÀɰʧ@,·|³Ý¦º.
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : °ß¨ä´L­«¦Û¤vªº¤H¡A¤~§ó«i©óÁY¤p¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD