·sª©ªÑ¥«¤½¶}¸ê°TÆ[´ú¯¸ªº¸ê®Æ§ì¨ìEXECL?
- ©«¤l
- 23
- ¥DÃD
- 1
- ºëµØ
- 0
- ¿n¤À
- 58
- ÂI¦W
- 0
- §@·~¨t²Î
- windows
- ³nÅ骩¥»
- Office 2016
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2014-2-26
- ³Ì«áµn¿ý
- 2018-8-23
|
·PÁª©¤jªº±Ð¾Ç¡A³o³¡¤À§ÚÀ´¤F^^
¥t¥~¡A¦A½Ð±Ðª©¤j¤@¨Ç°ÝÃD¡A§Æ±æª©¤j¤£nı±o·Ð¡A¦³ÂI¨}¤ß¹L·N¤£¥h~~
1.ª©¤jµ{¦¡¤¤¦³¤@Ó¤u§@¶¦pªG¥X²{¦P¦Wªº¸Ñ¨M¤è¦¡¡A
¥i¥H§â¥¦´«¦¨¦P¦W´NÂл\ì¤u§@¶¶Ü¡H(¥u¯d¤U³Ì«á§ó·sªº¸ê®Æ)
2.°õ¦æµ{¦¡®É¡A¤u§@¶·|ÀHµÛ¨C°õ¦æ¤@¦¸´N¤@ª½¼W¥[¡A¸Ó¦p¦ó²M°£¡H
3.¦bµ{¦¡¤¤¡A·|§â³Ì·s¤@¦~ªº¥|©u¤U¸ü§¹«á¡A·|©¹¤U±ªº"¦C"ªí¦b°õ¦æ²Ä¤G
¤G¦~ªº¤U¸ü¡A¸ê®Æ·|¦b¤U±ªº"¦C"¦s©ñ¡A¥i¥H³£§â¥¦Ì¥þ©ñ¦b²Ä¤@¦C¶Ü¡H
4.¦]¬°§ï²Ä3¶µ°ÝÃD®É¡A©u§O·|·Ó(105)1.2.3.4.(104¦~)1.2.3.4©u§O¦s©ñ¡A¥i¥H
±q²Ä¤@Äæ¶}©l´Nª½±µ©ñ³Ì·sªº©u§O¶Ü(¨Ò¡G¹³²{¦b¬O²Ä3©u¡A´N¥H²Ä3©u©ñ¦b¶}ÀY
³Â·Ðª©¤j¸Ñ´b¤F¡AÁÂÁÂ^^ |
|
|
|
|
|
|
- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¦^´_ 42# chang0833
¬O³o¼Ë¶Ü?- Option Explicit
- Sub Ex()
- Dim URL As String, xCo_Id As String
- Dim xSyear As Integer, xSseason As Integer
- Dim Sh(1 To 2) As Worksheet, Rng As Range
-
- xCo_Id = Application.InputBox("½Ð¿é¤JªÑ²¼¥N¸¹", , 2303) '¹w³]¬° 2303
- xSyear = Format(Date, "E") '¤¤µØ¥Á°êªº¦~«×
- xSseason = DatePart("q", Date) '·í©u
- Application.ScreenUpdating = False
- 'Set Wb = ThisWorkbook '«ü©w¬¡¶Ã¯
- With ThisWorkbook '«ü©w¬¡¶Ã¯
- Set Sh(1) = .Sheets.Add '·s¼W¤u§@ªí: ½Æ»s©u°]³ø¨ì«ü©w¤u§@¶
- Set Sh(2) = .Sheets.Add '·s¼W¤u§@ªí: WEB¬d¸ß¥Î
- End With
- On Error GoTo Er '³B²zµ{¦¡¤Wªº¿ù»~
- Application.DisplayAlerts = False
- Sh(1).Name = xCo_Id & "©u³øªí" '³o¦WºÙ¤u§@ªí¦p¤w¦s¦bµ{¦¡·|¦³¿ù»~
- Set Rng = Sh(1).[A1]
- On Error GoTo 0 '¤£¦A³B²zµ{¦¡¤Wªº¿ù»~
-
- Do
- URL = "URL;http://mops.twse.com.tw/server-java/t164sb01?step=1&CO_ID=" & xCo_Id & "&SYEAR=" & xSyear & "&SSEASON=" & xSseason & "&REPORT_ID=C"
- With Sh(2).QueryTables.Add(Connection:=URL, Destination:=Sh(2).[A1])
- .Name = xCo_Id & "_" & xSyear & "_²Ä" & xSseason & "©u" 'WEB¬d¸ßªº¦WºÙ
- .AdjustColumnWidth = True '¦Û°Ê½Õ¾ãÄæ¼e
- .WebSelectionType = xlSpecifiedTables
- .WebFormatting = xlWebFormattingNone
- .WebTables = "2,3,4" '¸ê²£t¶Åªí,ºî¦X·l¯qªí,²{ª÷¬y¶qªí
- .WebPreFormattedTextToColumns = True
- .WebConsecutiveDelimitersAsOne = True
- .WebSingleBlockTextImport = False
- .WebDisableDateRecognition = False
- .WebDisableRedirections = False
- .Refresh BackgroundQuery:=False
- If .ResultRange.Rows.Count > 2 Then '¦³¸ê®Æ
- Debug.Print xSyear, xSseason, Rng.Address
- .ResultRange.Copy Rng
- Set Rng = Rng.Offset(, .ResultRange.Columns.Count + 1)
- Else
- .Delete
- End If
- End With
- xSseason = xSseason - 1
- If xSseason = 0 Then
- xSseason = 4
- xSyear = xSyear - 1
- End If
- Loop Until xSyear = Format(Date, "E") - 3
-
- Sh(2).Delete
- Application.DisplayAlerts = True
- Application.ScreenUpdating = True
- ' Sh(1).Parent.Save
- MsgBox "Ok"
- Exit Sub
- Er: '³B²z xCo_Id &©u³øªí ¤u§@ªí¤w¦s¦b
- Sheets(xCo_Id & "©u³øªí").Delete 'Âл\ì¤u§@¶¶Ü¡H(¥u¯d¤U³Ì«á§ó·sªº¸ê®Æ)
-
- Resume '¦^¨ì¿ù»~ªºµ{¦¡½X
- End Sub
½Æ»s¥N½X |
|
|
|
|
|
|
- ©«¤l
- 23
- ¥DÃD
- 1
- ºëµØ
- 0
- ¿n¤À
- 58
- ÂI¦W
- 0
- §@·~¨t²Î
- windows
- ³nÅ骩¥»
- Office 2016
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2014-2-26
- ³Ì«áµn¿ý
- 2018-8-23
|
¦^´_ 43# GBKEE
¤Ó·PÁª©¤j¤F^^
´N¬O³o¼Ë¡A¨ä¤¤§Ú·Q¥HµÛµ{¦¡°µ¤@¨Ç¤pקï(¦Û¤v§V¤O¬Ý¬Ý)¡A¦pªG§ï¤£¥X¨Ó¡A¦A³Â·Ðª©¤j«ü¾É¤F¡A·P®¦^^ |
|
|
|
|
|
|
- ©«¤l
- 2
- ¥DÃD
- 0
- ºëµØ
- 0
- ¿n¤À
- 2
- ÂI¦W
- 0
- §@·~¨t²Î
- Win 7
- ³nÅ骩¥»
- 0ffice 2013
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW ¥x¥_ «H¸q°Ï
- µù¥U®É¶¡
- 2014-5-12
- ³Ì«áµn¿ý
- 2020-1-3
|
·PÁª©¤j±zªº¤À¨É, §Ú¤w¥Î VBA ¼gµ{¦¡§ì¨ú ¤½¶}¸ê°TÆ[´ú¯¸ ³\¦h¸ê®Æ ¦s¤J ACCESS DB µM«á¦A°µ¤ÀªR³B²z, ¤]¬O³o¤è±¦³¨Ç¸gÅ窺 ·R¦nªÌ, ¥]§t³B²z SEND GET, POST ©M Request COOKIES µ¥µ¥ ,
¦³¤@°ÝÃD«_¬N½Ð±Ð, ¤½¶}¸ê°TÆ[´ú¯¸ ³æ¦ì®É¶¡¤º ¦³³X°Ý¦¸¼Æ¨î(¦n¹³¬O¨C¤ÀÄÁ¨î³sÄò³X°Ýºô¶20¦¸¥ª¥k), ¦b¤j¶q§ì¨ú ºô¶¸ê®Æ®É, ±`¦³99%®É¶¡³£¦b©µ¿ðµ¥«Ý, §Ú´¿¸g·Q¥Î §ó§ï ip, ©Î¬O¦h½uµ{ ¥¦æ³B²z¨Ó¸Ñ¨M³oÓ°ÝÃD, ½Ð±Ð±z¬O¦p¦ó¸Ñ¨M¦¹¤@°ÝÃD?? ·PÁ«üÂI |
|
.
|
|
|
|
|
- ©«¤l
- 361
- ¥DÃD
- 57
- ºëµØ
- 0
- ¿n¤À
- 426
- ÂI¦W
- 0
- §@·~¨t²Î
- win7
- ³nÅ骩¥»
- 2003,2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-5-13
- ³Ì«áµn¿ý
- 2022-12-8
|
¦^´_ 45# yarchen
·|ÀÉ´N½ÕºC¤@ÂI¡A¤@¤ÀÄÁ¤Q¦¸¤]¦æ
¤£µM§ï¥Îvba xmlhttp post ¤èªk§ì
¤U±³oÓ³sµ²¡A¾Ç·|«á¦Û¤v´N·|קï
http://club.excelhome.net/thread-1159783-1-1.html |
|
|
|
|
|
|
- ©«¤l
- 28
- ¥DÃD
- 7
- ºëµØ
- 0
- ¿n¤À
- 43
- ÂI¦W
- 0
- §@·~¨t²Î
- windows7
- ³nÅ骩¥»
- office2010
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2013-11-8
- ³Ì«áµn¿ý
- 2020-4-9
|
¦^´_ 8# GBKEE
½Ð±ÐG¤j
¦pªG§Ú¦bEXCELªí¤¤¦C¥X¤@¦C20-30ӪѲ¼¥N¸¹
n¬d105²Ä¤T©u
""¸ê²£t¶Åªí""¤¤ªº¬Y¤@¬ì¥Ø"ex À³¥Iµu´Á²¼¨é¦Xp"ªº¾lÃB©ñ¦bªÑ²¼¥N¸¹®ÇÃä
¦p¦ó§Q¥Î³o°¦µ{¦¡¨Ó§ï?? |
|
¤p¤Hª«
|
|
|
|
|
- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¥»©«³Ì«á¥Ñ GBKEE ©ó 2016-12-24 09:07 ½s¿è
¦^´_ 47# jasonwu0114
¸Õ¸Õ¬Ý- Option Explicit
- Sub Ex()
- Dim URL As String, xCo_Id As Range, xSyear As String, xSseason As String, i As Integer, M As Variant
- xSyear = 105
- xSseason = 3
- For i = 1 To 20 '¶]20-30ӪѲ¼¥N¸¹
- Set xCo_Id = Sheets(1).Cells(i, "A") 'ªÑ²¼¥N¸¹
- URL = "URL;http://mops.twse.com.tw/server-java/t164sb01?step=1&CO_ID=" & xCo_Id & "&SYEAR=" & xSyear & "&SSEASON=" & xSseason & "&REPORT_ID=C"
- With SheetS(2).QueryTables.Add(Connection:=URL, Destination:=Sheets(2).Range("A1"))
- .AdjustColumnWidth = False '¦Û°Ê½Õ¾ãÄæ¼e
- .WebSelectionType = xlSpecifiedTables
- .WebFormatting = xlWebFormattingNone
- .WebTables = "2" ',3,4" '¸ê²£t¶Åªí,ºî¦X·l¯qªí,²{ª÷¬y¶qªí
- .WebPreFormattedTextToColumns = True
- .WebConsecutiveDelimitersAsOne = True
- .WebSingleBlockTextImport = False
- .WebDisableDateRecognition = False
- .WebDisableRedirections = False
- .Refresh BackgroundQuery:=False
- With .ResultRange '©Ò¶×¤J¸ê®Æªº½d³ò
- M = Application.Match("*À³¥Iµu´Á²¼¨é¦Xp", .Columns(1), 0) '¤u§@ªí¨ç¼Æ¦b²Ä¤@Ä椤¶Ç¦^¤ñ¹ï¨ìªºÄæ¦ì
- If IsNumeric(M) Then xCo_Id.Offset(, 1) = .Cells(M, "b") '¦³¤ñ¹ï¨ì¶Ç¦^ªºÄæ¦ìªº¼Æ¦r
- .Clear
- End With
- .Parent.Names(.Name).Delete '§R°£¤u§@ªíªº¦WºÙ
- .Delete ''³oQueryTable§R°£±¼
- End With
- Next
- End Sub
½Æ»s¥N½X |
|
|
|
|
|
|
- ©«¤l
- 28
- ¥DÃD
- 7
- ºëµØ
- 0
- ¿n¤À
- 43
- ÂI¦W
- 0
- §@·~¨t²Î
- windows7
- ³nÅ骩¥»
- office2010
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2013-11-8
- ³Ì«áµn¿ý
- 2020-4-9
|
¦^´_ 48# GBKEE
OK¤Ó´Î¤F
G¤j ·P®¦
²×©ó¸Ñ¨M§xÂZ§Úªø¤[¥H¨Óªº°ÝÃD
¤S¾Ç¨ì¦n´X©Û |
|
¤p¤Hª«
|
|
|
|
|