- ©«¤l
- 5
- ¥DÃD
- 1
- ºëµØ
- 0
- ¿n¤À
- 7
- ÂI¦W
- 0
- §@·~¨t²Î
- WINDOWN7
- ³nÅ骩¥»
- OFFICE2007
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2013-10-19
- ³Ì«áµn¿ý
- 2023-3-28
|
¥t¥~¥i¥H½Ð°Ý§Aªºurng¥Nªíªº¬O¤°»ò¶Ü¡H
urng¬O¥NªíÀx¦s®æ¤¤ªº¥N¸¹¡B
Dim WebSht As Worksheet, xURL$, GetInfo$, uRng As Range, ErrNo, LL, RR, CC, TT
Sub §ó·s¥þ³¡()
Dim y&, TM, i&
If MsgBox("n¥þ³¡§ó·s¶Ü¡H¡@", 4 + 32 + 256) = vbNo Then Exit Sub
TM = Time: ErrNo = 0: [A1] = "00:00:00"
[L5:ZZ600].ClearContents: [K6:K600].ClearContents: [L4].Select
Application.ScreenUpdating = False
y = [zz4].End(xlToLeft).Column: If y < 12 Then Exit Sub
For i = 12 To y Step 10
If ErrNo > 0 Then GoTo 102
Set uRng = Cells(4, i)
uRng.Select
If uRng <> "" Then Call §ó·sWeb: Call ¸ü¤J¼Æ¾Ú
[A1] = Format(Time - TM, "hh:mm:ss")
Next i
Application.ScreenUpdating = True
102: Beep
End Sub
Sub ¸ü¤J¼Æ¾Ú()
Dim lastrow&, TT, DD, SS
TT = Left(WebSht.[B4], Len(WebSht.[B4]) - 7)
DD = Right(TT, Len(uRng))
SS = Left(TT, Len(TT) - Len(uRng) - 1)
lastrow = WebSht.[b13].End(xlDown).Row
If DD <> uRng Then Exit Sub
uRng(2) = SS
uRng(2, -1).Resize(lastrow - 7, 1) = WebSht.[b13].Resize(lastrow - 7, 1).Value '¤é´Á¸ê®ÆÄæ
uRng(2, 1).Resize(lastrow - 7, 10) = WebSht.[c12].Resize(lastrow - 7, 10).Value '¤T¤jªk¤H¸ê®Æ
End Sub
Sub §ó·sWeb()
Dim DY1, DY2, DY3, DY4
Application.EnableCancelKey = xlErrorHandler
DY1 = Year(Date) - 1
DY2 = Year(Date)
DY3 = Month(Date)
DY4 = Day(Date)
Set WebSht = Sheets("Web")
WebSht.Cells.Clear
ErrNo = 0
On Error GoTo 101
xURL = "URL;http://jsjustweb.jihsun.com.tw/z/zc/zcl/zcl.djhtm?a=" & uRng & "&c=" & DY1 & "-" & DY3 & "-" & DY4 & "&d=" & DY2 & "-" & DY3 & "-" & DY4 & ""
With WebSht.QueryTables.Add(Connection:=xURL, Destination:=WebSht.[A1])
.AdjustColumnWidth = False
.WebSelectionType = xlAllTables
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.Refresh BackgroundQuery:=False
.Delete
End With
Exit Sub
101: ErrNo = Err.Number
End Sub |
|