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

[µo°Ý] ±qÃÒ¥æ©Ò§ì¨ú¦¬½L»ùªºVBA¤èªk½Ð¯q

[µo°Ý] ±qÃÒ¥æ©Ò§ì¨ú¦¬½L»ùªºVBA¤èªk½Ð¯q

¥Ø«e¤p§ÌÁÙ¬O¥Î³Ì°ò¥»ªºweb¸ê®Æ¶×¤J(YAHOOªÑ¥«)
²{¦b§ìYAHOOªºªÑ²¼
¶W¹L10µ§¥H¤W³t«×¤w¶}©l¦³ÂILAG¤F
·Q½Ð±Ð¤j¤j­Ì³£¬O¥Î¤°»ò¤èªk§â¨C¤éªº¦¬½L¸ê®Æ(ªÑ»ù³¡¤À)
¶×¤J¨ìEXCEL¸Ì­±ªº?
¥D­n¬O·Q¬Ý¦U¦ì¤j¤j³£¬O¥Î¤°»ò¤èªk?(ÃÒ¥æ©Òªº)
·|¤ñ¸û¤è«K,§Ú³o¼Ë¤@µ§¤@µ§ªº¦n¹³¤£¬O«Ü¦n¥Î

¦^´_ 1# bioleon69
±N¨C¤é¸ê®Æ¤@¤@¦s¤J SQL ¸ê®Æ®w´N¤£¦Ü©ó LAG ¤F¡C
»Ý­n®É¦A±q SQL ¸ê®Æ®w´£¨ú¸ê®Æ¡C

TOP

1¦¸§ì1µ§     vs.   1¦¸§ì1000µ§

TOP

¦^´_ 2# c_c_lai


«ç»ò¨Ï¥Î©O?
¤j¤j¬O§_Ä@·N¤À¨É±zªº¤è¦¡~~

TOP

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2016-9-18 21:13 ½s¿è

¦^´_ 4# bioleon69

TOP

¦^´_ 4# bioleon69

TOP

¥»©«³Ì«á¥Ñ ketrddem ©ó 2016-9-18 23:23 ½s¿è

¥Î¹d¦ëºô¨Ó§ì¾ú¥vªÑ»ù

²Ä¤@±iªí¬°¡u²M³æ¡v¡A³]©w§A­n§ì¨úªºªÑ²¼²M³æ¡A²Ä¤@¦C¬°ªÑ¸¹¡A²Ä¤G¦C¥H«á¨Ì§Ç¬°§AªºªÑ²¼¥N¸¹
·s¼W¤@­Ó¼Ò²Õ
SUB TEST()
Dim ªÑ¸¹ As String
Dim ¬d¸ß°_©l¤é As Date
¬d¸ß°_©l¤é = sheet1.Cells(1, 4)


For i = 2 To sheet1.Cells(Rows.Count, 1).End(xlUp).Row
ªÑ¸¹ = sheet1.Cells(i, 1).Value
On Error Resume Next
If Sheets(ªÑ¸¹) Is Nothing Then '«ü©wªº¤u§@ªí¤£¦s¦b
Sheets.Add After:=Sheets(Sheets.Count)
Sheets(Sheets.Count).Name = ªÑ¸¹
End If

Dim QT As QueryTable
Dim WebAddress As String
WebAddress = "http://www.cnyes.com/twstock/ps_historyprice/" & ªÑ¸¹ & ".htm"

With ThisWorkbook.Worksheets(ªÑ¸¹)
.Cells.Clear
Set QT = .QueryTables.Add("URL;" & WebAddress, .Range("$A$1"))
End With
With QT
.PostText = "ctl00$ContentPlaceHolder1$startText=" & ¬d¸ß°_©l¤é
.WebTables = "2"
.Refresh False
End With
Next
END SUB

¥H¤W¤èªk¬OWEB¬d¸ß¡A¨Ì¦¸±N²M³æªºªÑ²¼¾ú¥vªÑ»ù§ì¤U¨Ó¡A³t«×ÁÙOK¡C
¥t¤@ºØ¤èªk¬O¥Îwinhttp5.1ªº¤èªk¡A¯ÊÂI¬O¥u¾A¥Î32¨Ì¤¸¡A³t«×¤ñ¸û¹L¡Awinhttp5.1ªº¤èªk¤ñ¸û§Ö¡A¦ý¨ä¹ê®t¤£¤F¦h¤Ö¡C
¾ú¥vªÑ»ù§ì¤U¨Ó«á¡A´N¥Î¥t¤@­Ó¤u§@ï¡A¨Ï¥ÎSQL»yªk¥h§ì³o¸ê®Æ¡A¦A°µ­pºâ¡CSQL»yªk¥h§ì¡A¨ä¹ê¤]«Ü§Ö¡A¤§«á°µ­pºâ¡A«Øij¤£­nª½±µÅª¼gRANGE¥h­pºâ¡A¦Ó¬Oª½±µ¥Î°}¦C­pºâ¡A®Ä²v¤~·|°ª¡C
EXCEL VBA·s¤â¡A½Ð«e½ú¦h¦h«ü±Ð

TOP

¦^´_ 8# ketrddem

§A¦n,½Æ»sµ{¦¡½X¨ìexcelµo²{µLªk°õ¦æ
XD

TOP

¥»©«³Ì«á¥Ñ ketrddem ©ó 2016-9-18 23:27 ½s¿è

¦^´_ 9# bioleon69

´¡¤J¼Ò²Õ
»yªk¼g¨ì¼Ò²ÕùØ
µM«á­n³]©w¤@­Ó¬d¸ßªº°_©l¤é¡A§Ú¬O¼g¦bcells(1,4)
¾ú¥vªÑ»ù.rar (47.44 KB)
EXCEL VBA·s¤â¡A½Ð«e½ú¦h¦h«ü±Ð

TOP

¦^´_ 10# ketrddem


¦³ÂI½ÆÂø ¬Ý¤£¤ÓÀ´XDD
¬O§_¥i¥Hªþ­ÓÀÉ®×?

TOP

        ÀR«ä¦Û¦b : «Ý¤H°h¤@¨B¡A·R¤H¼e¤@¤o¡A´N·|¬¡±o«Ü§Ö¼Ö¡C
ªð¦^¦Cªí ¤W¤@¥DÃD