ªð¦^¦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¥Î

¦³¿ìªk¤@¦¸¥þ³¡Åã¥Ü¶Ü

TOP

³o¸Ì¤£¬O´N¦³§Öªù
https://tw.stock.yahoo.com/s/list.php?c=tse&pid=1

TOP

¥u­n¦¬½L»ù¡A´N§ó²³æ¤F
DDE¼g¤@¼g´N¦n¤F
EXCEL VBA·s¤â¡A½Ð«e½ú¦h¦h«ü±Ð

TOP

¦^´_ 12# ketrddem

¤]¤Ó²r!!(»·¥Ø
¤£¹L¤p§Ìªº»Ý¨D¥u­n¯à§ì¨úÃÒ¥æ©Òªº¦¬½L»ù§Y¥i
ÁÙ¤£¥Î¨ì³o»ò°ª¶¥ªº¾ú¥vªº¸ê®Æ
Àɮקڴú¸Õ¹L,Ū¨ú¦ü¥Gªá¤Ó¦h®É¶¡
¥u»Ý­n³Ì·s¦¬½L»ùªº¸ê®Æ§Y¥i

¦]¬°ÃÒ¥æ©Ò³o­Óºô¯¸ªººô§}¨S¿ìªk¸òYAHOO¤@¼Ë«á­±¥´ªÑ¸¹´N¦n
©Ò¥H·Q°Ý°Ý¬Ý¦U¦ì¤j¤j¬O«ç»ò§ìªº...

TOP

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

¦^´_ 11# bioleon69


­èªþ¤W¥h¤F¡A¦ý»¡¹ê¦bªº¡A§ì¾ú¥vªÑ»ù¨SÔ£¥Î³Bªº¡A°£«D§A¦³¿ïªÑÅÞ¿è¡A±NÅÞ¿è¼g¦¨§PÂ_¦¡¡A¥h¬D¥X§A­nªºªÑ²¼
¯u¥¿Ãøªº¤Ï¦Ó¬O¿ïªÑÅ޿誺¼gªk
§Ú¥Ø«e¼g¥X¥Î¾ú¥vªÑ»ùºâ¥Xkd­È¡A¥¬ªL³q¹D¡A§¡½uµ¥µ¥µ¥
´N¬O¥dÃö¦b¦p¦ó±N¿ïªÑÅÞ¿è¥Î»yªk§e²{¥X¨Ó
EXCEL VBA·s¤â¡A½Ð«e½ú¦h¦h«ü±Ð

TOP

¦^´_ 10# ketrddem


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

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

¦^´_ 8# ketrddem

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

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

        ÀR«ä¦Û¦b : ¡i®É¶¡¦pÆp¥Û¡j®É¶¡¹ï¤@­Ó¦³´¼¼zªº¤H¦Ó¨¥¡A´N¦pÆp¥Û¯ë¬Ã¶Q¡F¦ý¹ï·M¤H¨Ó»¡¡A«o¹³¬O¤@§âªd¤g¡A¤@ÂI»ù­È¤]¨S¦³¡C
ªð¦^¦Cªí ¤W¤@¥DÃD