- ©«¤l
- 2035
- ¥DÃD
- 24
- ºëµØ
- 0
- ¿n¤À
- 2031
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-3-22
- ³Ì«áµn¿ý
- 2024-2-1
|
¦^´_ 5# chairles59
¯÷±N GBKEE ª©¤jµ¹§Aªº´£¥Ü¾ã²z¨Ãµy¥[×¥¿¡A
¨ä¹ê GBKEE ª©¤j¤w¸g«ü¤Þ¥X§Aªº°ÝÃD©Ò¦b¡C- Sub Ex()
- Dim po As Integer ' «Å§i PO ¬°¾ã¼Æ
-
- lR = Range("A2").End(xlDown).Row ' R = 9 : Variant/Long
- Rows(lR + 1 & ":400").Clear ' ª½±µ²M°£Àx¦s®æ,¤£¥² Select ¦A§R°£
- ' Selection.Delete shift:=xlUp
-
- LRA = Range("B2").End(xlDown).Row ' LRA = 9 : Variant/Long
- For i = 3 To LRA
- ' If Cells(i, 3) <> "" Then ' ¤u§@ªí C Äæ ,¨S¦³¶R¶i¤é´Á,©Ò¥H¤£·|°õ¦æ¶×¤J¸ê®Æªºµ{¦¡½X
- If Cells(i, 3) = "" Then ' ×¥¿¬°ªÅȮɩl¶i¦æ¸ê®Æ¶×¤J
- Valuesno = "$A$" & i
- Linkss = "URL;https://tw.stock.yahoo.com/q/q?s=" & Cells(i, 1)
-
- po = lR - 5 + (7 * (i - 2)) ' ©w§ì¨ú¸ê®Æªí®æ°j°é
- With ActiveSheet.QueryTables.Add(Connection:= _
- Linkss, Destination:=ActiveSheet.Range("B" & po))
- .FieldNames = True
- .RowNumbers = False
- .FillAdjacentFormulas = False
- .PreserveFormatting = True
- .RefreshOnFileOpen = False
- .BackgroundQuery = True
- .RefreshStyle = xlInsertDeleteCells
- .SavePassword = False
- .SaveData = True
- .AdjustColumnWidth = True
- .RefreshPeriod = 0
- .WebSelectionType = xlSpecifiedTables
- .WebFormatting = xlWebFormattingNone
- .WebTables = "6"
- .WebPreFormattedTextToColumns = True
- .WebConsecutiveDelimitersAsOne = True
- .WebSingleBlockTextImport = False
- .WebDisableDateRecognition = False
- .WebDisableRedirections = False
- .Refresh BackgroundQuery:=False
- .Name = .ResultRange.Cells(3, 1)
- End With
-
- Range("A" & po + 2) = Cells(i, 1)
- ' Cells(i, 2) = "=vlookup(" & Cells(i, 1) & ",$A$16:$O$200,2,0)" ' ¬O^¤å¦r¥À O,¤£¬O¼Æ¦r 0
- Cells(i, 2) = "=vlookup(" & Cells(i, 1) & ",$A$11:$O$200,2,0)" ' ±q $A$16 °_©l¤§½d³ò·|³y¦¨ B3 ±o¥X¤£¥¿½TÈ
- Cells(i, 2) = Mid(Cells(i, 2).Text, 5) ' Mid(Cells(i, 2), 5) ·|²£¥Í°õ¦æ¶¥¬q¿ù»~ 13 «¬ºA¤£²Å
-
- ' Cells(i, 7) = "=vlookup(" & Cells(i, 1) & ",$A$16:$O$200,4,0)" ' ¬O^¤å¦r¥À O,¤£¬O¼Æ¦r 0
- Cells(i, 7) = "=vlookup(" & Cells(i, 1) & ",$A$11:$O$200,4,0)" ' ±q $A$16 °_©l¤§½d³ò·|³y¦¨ G3 ±o¥X¤£¥¿½TÈ
- End If
- Next
- End Sub
½Æ»s¥N½X |
|